Wrapper class is a class which used convert value type.
Convert from string to integer by wrapper class.Here "Integer" as a wrapper class.
class wrapper
{
public static void main(String args[])
{
String x="1";
String y="2";
int p=Integer.parseInt(x);
int q=Integer.parseInt(y);
int z=p+q;
System.out.println(z);
}
}
Convert from string to integer by wrapper class.Here "Integer" as a wrapper class.
Example:
class wrapper
{
public static void main(String args[])
{
String x="1";
String y="2";
int p=Integer.parseInt(x);
int q=Integer.parseInt(y);
int z=p+q;
System.out.println(z);
}
}
No comments:
Post a Comment