Thursday 18 February 2016

Java Tutorial : Java wrapper class to primitive datatypes


Click here to watch in Youtube :
https://www.youtube.com/watch?v=JI2CxQY2TAI&list=UUhwKlOVR041tngjerWxVccw

Click the below Image to Enlarge
Java Tutorial : Java wrapper class to primitive datatypes 
Java Tutorial : Java wrapper class to primitive datatypes 
WrapperClassTest.java
public class WrapperClassTest
{

    public static void main(String[] args)
    {
        Integer integerObj = new Integer(10);

        byte byteValue = integerObj.byteValue();
        System.out.println("byteValue = " + byteValue);

        short shortValue = integerObj.shortValue();
        System.out.println("shortValue = " + shortValue);

        int intValue = integerObj.intValue();
        System.out.println("intValue = " + intValue);

        long longValue = integerObj.longValue();
        System.out.println("longValue = " + longValue);

        float floatValue = integerObj.floatValue();
        System.out.println("floatValue = " + floatValue);

        double doubleValue = integerObj.doubleValue();
        System.out.println("doubleValue = " + doubleValue);
    }

}
Output
byteValue = 10
shortValue = 10
intValue = 10
longValue = 10
floatValue = 10.0
doubleValue = 10.0

Refer:

Click the below link to download the code:
https://sites.google.com/site/javaee4321/java/WrapperClassDemo_Number_methods.zip?attredirects=0&d=1

Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/WrapperClassDemo_Number_methods

Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/cedeb080226a76d0729219432daf4c1927cf3540/BasicJava/WrapperClassDemo_Number_methods/?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