Datatype Conversions
//To demonstrate DataType conversionspublic class Convert_2_int
{
public static void main(String[] args)
{
String s="123";
int a=Integer.parseInt(s);
Float b=Float.parseFloat(s);
System.out.println(a);
System.out.println(b);
}
}
No comments:
Post a Comment