doubleout.java
来自「Java 入门书的源码」· Java 代码 · 共 20 行
JAVA
20 行
//Copyright (c) 1998, Arthur Gittleman
//This example is provided WITHOUT ANY WARRANTY either expressed or implied.
/* Create float and double values
* Check Java println output
*/
public class DoubleOut {
public static void main(String [] args) {
double five3rds = 5.0/3.0;
System.out.println("Double 5.0/3.0 = " + five3rds);
double threeHalves = 3.0/2.0;
System.out.println("Double 3.0/2.0 = " + threeHalves);
System.out.println("big " + 1234567898765.4);
System.out.println("notSoBig " + 12345.678987654);
System.out.println("notSoSmall " + .0123456789);
System.out.println("small " + .0000123456789);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?