Latest Answer : In Java == is used to check the referance of variablesbut . equals is used to check the value. ...
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.
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 ==.
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 ...
Latest Answer : HashCode is not in hexadecimal format... i believe. ...
Latest Answer : equals is the method of object used for comparing the objects where as == is used for numberic comparisions ...
Why should we implement equals() and hashCode() while using hastable?