Wrapper Class - Converting string object to primitive numbers in Java

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.

Source Code

public class wrapperClass4 {
    public static void main(String args[])
        //Converting string object to primitive numbers.
        String SI="25";
        Integer I= Integer.valueOf(SI);
        int i= I.intValue();
        String SD="25.25";
        Double D= Double.valueOf(SD);
        double d= D.doubleValue();


To download raw file Click Here

Basic Programs