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
How do you sort in descending order in java using collections sort?
Why 1 is not a prime number?
What is defined as false sharing in the context of multithreading?
Can a serialized object be transferred via network?
Are arrays static in java?
Why scanner is used in java?
What is abstract class? Explain
Can we catch more than one exception in a single catch block?
What is the internal implementation of set in java?
Which collection is ordered in java?
Explain the difference between collection api and stream api in java8?
What is class and its types?
List out benefits of object oriented programming language?
What is the function of character?
Class c implements interface I containing method m1 and m2 declarations. Class c has provided implementation for method m2. Can I create an object of class c?