W3School TIY Editor

  • W3School 在线教程
  • 改变方向
  • 暗黑模式
​x
 
public class Main {
  public static void main(String[] args) {
    double myDouble = 9.78d;
    int myInt = (int) myDouble; // 显式转换:double 转 int
​
    System.out.println(myDouble);
    System.out.println(myInt);
  }
}