為什么在eclipse里面else這行寫著錯誤
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括號后面的雙引號去掉就行
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("未成年");
}
? ? ? ??