?? castingnumbers.java
字號:
////////////////////////////////////////////////
//Cast a float or double to an integral value
///////////////////////////////////////////////
//: c03:CastingNumbers.java
// What happens when you cast a float or double to an integral value?
// From 'Thinking in Java, 3rd ed.' (c) Bruce Eckel 2002
// www.BruceEckel.com. See copyright notice in CopyRight.txt.
public class CastingNumbers {
public static void main(String[] args) {
double above = 0.7, below = 0.4;
System.out.println("above: " + above);
System.out.println("below: " + below);
System.out.println("(int)above: " + (int)above);
System.out.println("(int)below: " + (int)below);
System.out.println("(char)('a' + above): " + (char)('a' + above));
System.out.println("(char)('a' + below): " + (char)('a' + below));
}
} ///:~
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -