為什么在eclipse里面else這行寫著錯(cuò)誤
package hello;
public class hello {
? ? public static void main(String[] args) {
int age=25;
if(age>=18);
{System.out.println("成年");
}else{
System.out.println("未成年");
}
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
}
}
2017-08-27
你把if括號(hào)后面的雙引號(hào)去掉就行
2017-08-27
package hello;
public class hello {
? ? public static void main(String[] args) {
int age=25;
if(age>=18)
{System.out.println("成年");
}else{
System.out.println("未成年");
}
? ? ? ??