Site hosted by Angelfire.com: Build your free website today!
       
The Digital Reference Section

Example JAVA Program (String conversion)
by Rodelio Barcenas

 /*
This program converts Strings to other data types
*/

public class stringTo {

public static void main(String arg[]){

String a,b;
int x;
float y;
double z;
a = "13";
b = "-0.7";

x = Integer.parseInt(a);
y = Float.parseFloat(b);
z = Double.parseDouble(b);

System.out.println("Integer: "+x);
System.out.println("Float: "+y);
System.out.println("Double: "+z);
}
}


The PinoyTechZone.Com
Copyright 2002-2003
All rights Reserved