我试图将 int 的用户输入与 String 数组进行比较。
import java.util.Arrays;
import java.util.Scanner;
public class Array{
public static void main(String[]args) {
Scanner input = new Scanner(System.in);
int number;
String [] month = new String[13];
month[0] = "Null";
month[1] = "January";
month[2] = "February";
month[3] = "March";
month[4] = "April";
month[5] = "May";
month[6] = "June";
month[7] = "July";
month[8] = "August";
month[9] = "September";
month[10] = "October";
month[11] = "November";
month[12] = "December";
System.out.println("Enter a number");
number = input.nextInt();
}
}
qq_笑_17
一只斗牛犬
相关分类