Comparing Strings not Working in Java -


this question has answer here:

i'm importing string file , string "computer_made". if execute code, though, not print "the computer made!" ideas?

if (data=="computer_made")     {     computer=true;     system.out.println("the computer made!");     } 

you should use .equals string comparison!!

if (data.equals("computer_made")) { computer=true; system.out.println("the computer made!"); } 

refer here more info


Comments

Popular posts from this blog

javascript - three.js lot of meshes optimization -

smartface.io - Proper way to change color scheme for whole application -

Email notification in google apps script -