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
Why is a constant variable important?
Is binary a low level language?
What is a class variable?
What is foreach loop in java?
How do you sort a string in java?
Explain about main thread in java?
Can the garbage collection be forced by any means?
When arithmeticexception is thrown?
What access modifiers can be used for variables?
What string is utf8?
what is optional in java 8?
What is class??
Difference between static and dynamic class loading.
Write a program to check for a prime number in java?
When should the method invokelater() be used?