Wrapper Classes in Java - Java Programming - The Java Concepts Part

Wrapper Classes in Java - Java Programming - The Java Concepts Part

Wrapper Classes in Java

Each of Java's eight primitive data type has a class dedicated to it. These are known as wrapper classes because they "wrap" the primitive data type into an object of that class.

To use lower case letters and Upper case letters in Java applications, Java has given a set of conventions

Difference Between Primitive or Wrapper Class

Primitive

boolean, byte, char, int, float, double, long, short,

Wrapper Class

Boolean, Byte, Character, Integer, Float, Double, Long, Short,

Example Wrapper Class

public static void main(String [ ]args){
int i=10;//single value container
Integer iRef=new Integer(i);
int j=iRef.intValue();
Integer kRef=i;
int L=kRef //Auto Unboxing)
}
}

Comments

Popular posts from this blog

Java & Java Uses - thejavaconceptsparts

Buzzword in Java - thejavaconceptspart

Java Naming Conventions - thejavaconceptspart