Friday, 19 February 2016

Java Tutorial : Java wrapper class(equals method)


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) 
WrapperClassTest.java
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);

    }
}
Output
result = false
Click the below link to download the code:
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:
  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • No comments:

    Post a Comment