為什么是錯(cuò)誤的
public class HelloWorld {
???? public static void main (String[] args){
??? ? int age=25;
?? String xx;
?? if(age>=18);{
?? xx="成年";
?? }
?? else {
??? xx="未成年";
??? }
???System.out.println("null"+xx);
? }
}
public class HelloWorld {
???? public static void main (String[] args){
??? ? int age=25;
?? String xx;
?? if(age>=18);{
?? xx="成年";
?? }
?? else {
??? xx="未成年";
??? }
???System.out.println("null"+xx);
? }
}
2016-01-17
舉報(bào)
2016-02-28
if語(yǔ)句后不應(yīng)該加; ?
2016-01-17
if條件判斷不是執(zhí)行語(yǔ)句,因此后不必加;
2016-01-17
if()后面你接了;號(hào)