runtimedimension.java

来自「《A first book of java》by Gary J.Bronson 」· Java 代码 · 共 19 行

JAVA
19
字号
import javax.swing.*;
public class RunTimeDimension
{
  public static void main(String[] args)
  {
    inti, numgrades;
    String s1;
    s1 = JOptionPane.showInputDialog("Enter the number of grades to be processed: ");
    numgrades = Integer.parseInt(s1);
    
    int grade[] = new int[numgrades]; // allocate the array
 
    System.out.println("An array was created for " + numgrades + " integers.");
    System.out.println(" The values stored in the array have been initialized to:");
    for (i = 0; i < numgrades; i++)
      System.out.println("grade[" +i +"] is " + grade[i]);
    System.exit(0); 
  }
}

⌨️ 快捷键说明

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