A Wrapper class is a class whose object wraps or contains primitive data types. When we create an object to a wrapper class, it contains a field and in this field, we can store primitive data types. In other words, we can wrap a primitive value into a wrapper class object.
public class wrapperClass5 { public static void main(String args[]) { //Converting numeric string object to primitive numbers. /*String SI="25"; Integer I= Integer.valueOf(SI); int i= I.intValue(); System.out.println(i);*/ String SI="25"; int i=Integer.parseInt(SI); System.out.println("int Value : "+i); String SF="25.25f"; float f=Float.parseFloat(SF); System.out.println("float Value : "+f); } }
int Value : 25 float Value : 25.25To download raw file Click Here
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions