typetrans2.java
来自「Java面向对象编程(随书配套源代码) 阐述了面向对象编程的思想」· Java 代码 · 共 20 行
JAVA
20 行
package chapter3;
public class TypeTrans2
{
public static void main(String[] args)
{
int three = 3;
int two = 2;
double result = 0;
result = 1.5 + three/two;
System.out.println("result1=" + result);
result = 1.5 + (double) three/two;
System.out.println("result2=" + result);
result = 1.5 + three/(double)two;
System.out.println("result3=" + result);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?