![]() Related Questions Latest Answer : CASE1: String s3 = "hi"; String s="hi"; String s2=s3; ... Latest Answer : Hai,== will check the equality of the references of the objects where as.equals will check the equality of the content. ... Tell me o/p of the mentioned code fragment.String s1 = "shailesh";String s2="shailesh";System.out.println(s1.equals(s2));System.out.println(s1==s2); Answer is truetrueEvery time we make any string constant same memory referenced will be assigned if the string constant is same. That's why both obj. s1 and s2 refer to same memory. View Question | Asked by : Shailesh What is the difference between equals() method and == operator.when we use 2 same strings for finding of whether both strings r equal or not by using these two,it will give same answers.i.e true and true.so what is the main defference between equals() and ==. Read Answers (2) | Asked by : haritha A) newB) dotC) equalsD) none of the above Latest Answer : You would use the _new___ operator to create a single instance of a named classex public class XyzXyz x=new Xyz();here x is instance of class Xyz using new operator ... Latest Answer : the operator == compares the content of two stringsequals method compares the references of two variablesgenerally we use == operator for comparing numbersthankssanjay bandi ... Read Answers (8) | Asked by : divya Latest Answer : A hash code is a number;example:claa A{}In the above class i am creating two instance;A obj=new A();B obj1=new A();now obj is geting the reference and obj1 also getting the reference;but both obj and obj1 having reference are difference.if(obj==obj1)the ... Read Answers (8) | Asked by : divya Latest Answer : equals is the method of object used for comparing the objects where as == is used for numberic comparisions ... Read Answers (2) | Asked by : meenal Why should we implement equals() and hashCode() while using hastable? Latest Answer : You must override hashCode in every class that overrides equals(). Equal objects must have equal hash codes. In other words, If two objects are equal according to the equals (Object)method, then calling the hashCode method on each of the two objects must ...
Sponsored Links
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||