Click here to watch in Youtube :
https://www.youtube.com/watch?v=Vf_tw-t0-oY&list=UUhwKlOVR041tngjerWxVccw
Click the below Image to Enlarge
Java Tutorial : Java wrapper class(equals method) |
public class WrapperClassTest { public static void main(String[] args) { Integer integerObj1 = new Integer(100); Integer integerObj2 = new Integer(10); /* * public boolean equals(Object obj) * * Parameters: * ----------- * * obj - the object to compare with. * * Returns: * -------- * * Determines whether this number object is equal to * the argument. The methods return true if the * argument is not null and is an object of the same * type and with the same numeric value. */ boolean result = integerObj1.equals(integerObj2); System.out.println("result = " + result); } }
result = false
https://sites.google.com/site/javaee4321/java/WrapperClassDemo_equals_method.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/WrapperClassDemo_equals_method
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/cedeb080226a76d0729219432daf4c1927cf3540/BasicJava/WrapperClassDemo_equals_method/?at=master
See also:
No comments:
Post a Comment