public class HelloWorld{
public static void main(String[] args) {
int a=12;
int b=24;
int sum=a+b;
System.out.println("两数之和为:"+sum);
}
}
public static void main(String[] args) {
int a=12;
int b=24;
int sum=a+b;
System.out.println("两数之和为:"+sum);
}
}
2015-02-21
public class HelloWorld{
public static void main(String[] args) {
// System.out.println("Java");
System.out.println("imooc");
/* System.out.println("Oracle");
System.out.println("MySQL");*/
}
}
public static void main(String[] args) {
// System.out.println("Java");
System.out.println("imooc");
/* System.out.println("Oracle");
System.out.println("MySQL");*/
}
}
2015-02-21
public class HelloWorld{
public static void main(String[] args) {
final String SEX="男";
final String SEY="女";
System.out.println(SEX+"\n"+SEY);
}
}
public static void main(String[] args) {
final String SEX="男";
final String SEY="女";
System.out.println(SEX+"\n"+SEY);
}
}
2015-02-21
== 用于比较变量中存放的值,所以示例中两个字符串内容一致,但是由于是两个变量分别引用了两个String类型对象,内存地址不同,所以答案是false.
2015-02-21
String name="爱慕课";
char sex='男';
int num=18;
double price=120.5;
boolean isOK=true;
System.out.println(name);
System.out.println(sex);
System.out.println(num);
System.out.println(price);
System.out.println(isOK);}}
char sex='男';
int num=18;
double price=120.5;
boolean isOK=true;
System.out.println(name);
System.out.println(sex);
System.out.println(num);
System.out.println(price);
System.out.println(isOK);}}
2015-02-19