whats the difference between == and .equal ?
Answer Posted / james rajesh
One database tale contain id and name...mostly id's are in int and name's are in String...if u want to compare with id and one number means u use ==
like, if(id==1)
if u want to compare name means u use .equals
like, if(name.equals("Bangalore"))
So point of view,
== used to compare integer
.equals used to compare String
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What the difference is between execute, execute Query, execute Update?
What is the difference between length and length () in java?
Can we have two main methods in a java class?
What is passing by reference in java?
What is difference between printf and scanf?
What is the main advantage of passing argument by reference?
How will you serialize a singleton class without violating singleton pattern?
How do I stop concurrentmodificationexception?
What is the difference between an argument and a parameter?
What is a java applet? What is an interface?
What is qms certification?
Is it correct to say that due to garbage collection feature in java, a java program never goes out of memory?
What is the difference between menuitem and checkboxmenu item?
How can we make a class singleton?
Are arrays static in java?