String name="爱慕课";
char sex='男';
int num=18;
double price=120.5;
boolean isOK=true;
char sex='男';
int num=18;
double price=120.5;
boolean isOK=true;
2015-04-09
public class HelloWorld{
public static void main(String[] args) {
String a="我爱慕课网";
String b="www.imooc.com";
char c='\n';
System.out.println(a+c+b);
}
}
public static void main(String[] args) {
String a="我爱慕课网";
String b="www.imooc.com";
char c='\n';
System.out.println(a+c+b);
}
}
2015-04-09
int score = 94;
String sex = "女";
if(score>80){
if(sex.equals("女"));{
System.out.println("进入女子决赛");
else
System.out.println("进入男子决赛");}
else
System.out.println("拜拜,我回工地了");}
}
}
String sex = "女";
if(score>80){
if(sex.equals("女"));{
System.out.println("进入女子决赛");
else
System.out.println("进入男子决赛");}
else
System.out.println("拜拜,我回工地了");}
}
}
2015-04-09
public class HelloWorld{
public static void main(String[] args) {
String love="我爱慕课网";
String id="www.imooc.com";
System.out.println(love);
System.out.println(id);
}
}
public static void main(String[] args) {
String love="我爱慕课网";
String id="www.imooc.com";
System.out.println(love);
System.out.println(id);
}
}
2015-04-09
public class HelloWorld {
public static void main(String[] args) {
int one = 20 ;
if ((one%2) == 0)
System.out.println("one是偶数");
}
}
public static void main(String[] args) {
int one = 20 ;
if ((one%2) == 0)
System.out.println("one是偶数");
}
}
2015-04-09
int sum = 0;
for (int i = 1; i <= 10; i++) {
sum = sum + i;
if ( sum>20 ) {
break;
}
}System.out.print("当前的累加值为:" + sum);
for (int i = 1; i <= 10; i++) {
sum = sum + i;
if ( sum>20 ) {
break;
}
}System.out.print("当前的累加值为:" + sum);
2015-04-09
public class HelloWorld{
public static void main(String[] args) {
String city="美国加州";
System.out.println("我的家乡在:"+city);
}
}
public static void main(String[] args) {
String city="美国加州";
System.out.println("我的家乡在:"+city);
}
}
2015-04-09