fruit.java

来自「Java2入门经典第二章源码」· Java 代码 · 共 18 行

JAVA
18
字号
public class Fruit
{
  public static void main(String args[])
  {
    // Declare and initialize three variables
    int numOranges = 5;                   // Count of oranges
    int numApples = 10;                   // Count of apples
    int numFruit = 0;                     // Count of fruit

    numFruit = numOranges + numApples;    // Calculate the total fruit
        
    // Display the result
    System.out.println("A totally fruity program");
    System.out.println("Total fruit is " + numFruit);
  }
}  

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?