package com.convert;
public class TypeConvert {
public static void main(String[] args) {
//long类型转换成int类型
long l = 8L;
int a = 0;
a = new Long(l).intValue();
System.out.println(a);
//String类型转换成int类型
String str = "55";
int b = 0;
b = Integer.valueOf(str);
System.out.println(b);
}
}
public class TypeConvert {
public static void main(String[] args) {
//long类型转换成int类型
long l = 8L;
int a = 0;
a = new Long(l).intValue();
System.out.println(a);
//String类型转换成int类型
String str = "55";
int b = 0;
b = Integer.valueOf(str);
System.out.println(b);
}
}