能幫我看錯哪里了嗎?看不出來???
?public class HelloWorld {
? ? public static void main(String[] args) {
int age=25;
if(age>=60){
? ?System.out.println("老年"):
}else if(age>40&&age<60 )
{
? ? System.out.println("中年"):
}else if(age>18&&age<40 )
{
? ? System.out.println("少年"):
}else{
? ? System.out.println("童年"):
}
}
} ?
2017-07-12
public class HelloWorld {
??? public static void main(String[] args) {
??int age=25;
?if(age>60){System.out.println(("老年");}else if(age>40){System.out.println("中年");}else if(age>18){System.out.println("少年");}else{System.out.println("童年");}
???
???
???
???
???
???
???
???
???
???
???
???
?}
}
2017-07-08
我看出了,是我自己混用了冒號和分號。