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

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -