已采纳回答 / yifei8
符号不规范,大小括号及冒号请使用英文的,以下运行正确的代码:public static void main(String[] args) { int score=68; String mark =(score>=60)?"及格":"不及格"; System.out.println(mark); }
2015-11-30
已采纳回答 / Irays
你写的是java?public class HelloWorld { public static void main(String[] args) { int score = 94; String seX="女"; if(score>80){ if(seX=="男"){//相等最好用seX.equals("男") System.out.println("进入男子组决赛"); }else{ ...
2015-11-29
已采纳回答 / Irays
+号,在java是有特殊意义的,1表示计算,2字符串的拼接例如int a=10;String str="1"+aSystem.out.print(str);//110System.out.print(str+1);//1101System.out.print(a+100);//110System.out.print("10+10="+20);//10+10=20
2015-11-29
已采纳回答 / crjing
break表示跳出循环,后面有,也不继续了,continue表示跳过,只跳过这次,后面的循环还是要继续的写在哪个位置?一般写到循环语句中,然后判断是否满足想要的结果,如果满足了就不在循环,这时可以使用break跳出循环,或使用continue跳过此次循环。这两个一般循环语句用的比较多,举个例子for (int i=0;i<10;i++){ //循环10次 if (i=4){ continue; //如果i为4,则跳过此次for循环,继续下次循环(开始循环i=5、6...
2015-11-29