不是声明;预期的
我试图将输入的值放入数组中。但它说的不是声明
我是编程新手,我正在尝试自学 java
import java.util.Scanner;
public class MainClass {
public static void main(String[] args){
int[] studID = new int[100];
String[] Lname = new String[100];
String[] Fname = new String[100];
String[] studProgram = new String[100];
int[] studYear = new int[100];
System.out.println("1. add student");
System.out.println("2. view student");
System.out.println("3. edit student");
System.out.println("4. delete student");
System.out.print("Please choose: ");
Scanner scan = new Scanner(System.in);
int choice = scan.nextInt();
switch(choice){
case 1:
System.out.print("Enter ID: ");
studID[] = scan.nextInt();
System.out.print("Enter Last name: ");
Lname[] = scan.next();
System.out.print("Enter First name: ");
Fname[] = scan.next();
System.out.print("Enter Course: ");
studProgram[] = scan.next();
System.out.print("Enter Year: ");
studYear[] = scan.nextInt();
case 2:
System.out.println("Enter student ID to view: ");
int studView = scan.
}
}
}
我期望当我将学生的值放入数组中时,如果我选择查看学生ID,它还会显示依赖学生ID的学生的其他信息
牧羊人nacy
波斯汪
交互式爱情
临摹微笑
相关分类