Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
type
Wrapper class
boolean
Boolean
char
Character
double
Double
float
Float
int
Integer
long
Long
Conversion action
Conversion action
Int i=v1.intValue();
float f=v1.floatValue();
Object to float
long l=v1.longValue();
double d=v1.doubleValue();
Conversion action
Str=Integer.toString(i)
Str=Float.toString(f);
Str=Double.toString(d);
Str=Long.toString(l)
Conversion action
D=dobule.ValueOf(str)
F=Float.ValueOf(str)
I=Integer.ValueOf(str)
L=Long.ValueOf(str)
Conversion action
int i=Integer.parseInt(str);
long i=Long.parseLong(str);
class wrapperclassex
{
public static void main(String args[])
{
Float p=new Float(0);
Integer a=0;
try
{
DataInputStream in=new DataInputStream(System.in);
System.out.println("enter Float value");
String F=in.readLine();
p=Float.valueOf(F);
System.out.print("Enter integer value");
System.out.flush();
String I=in.readLine();
a=Integer.parseInt(I);
}
catch(IOException e)
{
System.out.println("I/O Error");
System.exit(1);
}
System.out.println(p.floatValue()));
System.out.println(a);
}}