Home > database >  Bosses, o Java problem don't understand, Chou Chou
Bosses, o Java problem don't understand, Chou Chou

Time:10-31

Package test1.

Public class Switch {

Public static void main (String [] args)
{
Int Day=Integer. ParseInt (args [0]).
The switch (Day) {
Case 1:
System. The out. Println (" Monday ");
Break;
Case 2:
System. The out. Println (" Tuesday ");
Break;
Default:
System. The out. Println (" invalid ");
Break;


}
}
}


Error Exception in the thread "is the main" Java. Lang. ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
The at test1/test1. Switch. The main (Switch. Java: 7)

As the index beyond what restrictions

CodePudding user response:

It is not obvious, you preach value may pass multiple values, you're a ah