//小淇在敲代码
package p2;
public class 整数与浮点数数据类型的转换 {
public static void main(String[] args) {
// TODO Auto-generated method stub
int a=155;
int b=9;
float g,h;
System.out.println("a="+a+",b="+b);
g=a/b;
System.out.println("a/b="+g);
System.out.println("a="+a+",b="+b);
h=(float)a/b;
System.out.println("a/b="+h);
System.out.println("(int)h="+(int)h);
}
}
11-01
230