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
Post a Comment