java - The difference between = and == -


what difference between = true , == true in :

 void startengine(){    if ( enginestat == true )        system.out.println("the engine on ");  else { enginestat = true;        system.out.println("the engine on");        } 

== outputs boolean represents whether 2 expressions equal. (the boolean equal true or false).

= assigns value of expression on right side variable on left.


Comments

Popular posts from this blog

php - Hide output during test execution -

javascript - Migrate custom AngularJS filter from 1.2.28 to 1.4.x -

Update Magento products with multiple images -