Monday, 22 February 2016

Java Tutorial : Java wrapper class (Max and Min)


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

WrapperClassTest.java
/*
 * The Number classes include constants and useful class 
 * methods.The MIN_VALUE and MAX_VALUE constants contain 
 * the smallest and largest values that can be contained 
 * by an object of that type. 
 */
public class WrapperClassTest
{

    public static void main(String[] args)
    {
        System.out.println("Byte Max Value = " + Byte.MAX_VALUE);
        System.out.println("Byte Min Value = " + Byte.MIN_VALUE);

        System.out.println("Short Max Value = " + Short.MAX_VALUE);
        System.out.println("Short Min Value = " + Short.MIN_VALUE);

        System.out
                .println("Integer Max Value = " + Integer.MAX_VALUE);
        System.out
                .println("Integer Min Value = " + Integer.MIN_VALUE);

        System.out.println("Long Max Value = " + Long.MAX_VALUE);
        System.out.println("Long Min Value = " + Long.MIN_VALUE);

        System.out.println("Float Max Value = " + Float.MAX_VALUE);
        System.out.println("Float Min Value = " + Float.MIN_VALUE);

        System.out.println("Double Max Value = " + Double.MAX_VALUE);
        System.out.println("Double Min Value = " + Double.MIN_VALUE);

    }
}
Output
Byte Max Value = 127
Byte Min Value = -128
Short Max Value = 32767
Short Min Value = -32768
Integer Max Value = 2147483647
Integer Min Value = -2147483648
Long Max Value = 9223372036854775807
Long Min Value = -9223372036854775808
Float Max Value = 3.4028235E38
Float Min Value = 1.4E-45
Double Max Value = 1.7976931348623157E308
Double Min Value = 4.9E-324
Click the below link to download the code:
https://sites.google.com/site/javaee4321/java/WrapperClassDemo_Max_Min_App.zip?attredirects=0&d=1

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

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

    Google+ Followers

    Google+ Badge