public class Main {
/*
N o w J a v a . c o m 提供
*/
public static void main(String[] args) {
Long lObj = new Long("10");
//use byteValue method of Long class to convert it into byte type.
byte b = lObj.byteValue();
System.out.println(b);
//use shortValue method of Long class to convert it into short type.
short s = lObj.shortValue();
System.out.println(s);
//use intValue method of Long class to convert it into int type.
int i = lObj.intValue();
System.out.println(i);
/*
NowJava.com - 时 代 Java 提供
*/
//use floatValue method of Long class to convert it into float type.
float f = lObj.floatValue();
System.out.println(f);
/**代码未完, 请加载全部代码(NowJava.com).**/
本文系作者在时代Java发表,未经许可,不得转载。如有侵权,请联系nowjava@qq.com删除。