public class HelloWorld{
public static void main(String[] args) {
final String sex1 = "男";
final char sex2 = '女';
System.out.println("sex1->"+sex1);
System.out.println("sex2->"+sex2);
}
}
可以试试string和char定义相应的常量的区别
public static void main(String[] args) {
final String sex1 = "男";
final char sex2 = '女';
System.out.println("sex1->"+sex1);
System.out.println("sex2->"+sex2);
}
}
可以试试string和char定义相应的常量的区别
2015-05-10
public class HelloWorld{
public static void main(String[] args) {
String ha = "我爱慕课网";
String body ="www.imooc.com";
System.out.println(ha);
System.out.println(body);
}
}
public static void main(String[] args) {
String ha = "我爱慕课网";
String body ="www.imooc.com";
System.out.println(ha);
System.out.println(body);
}
}
2015-05-10
String[][]names={{"tom","jack","mike"},{"zhangsan","lisi","wangwu"}};
for (int i = 0; i <names.length; i++) {
for (int j = 0; j < names[i].length; j++) {
System.out.println(names[i][j]);
}
System.out.println();
} } }
for (int i = 0; i <names.length; i++) {
for (int j = 0; j < names[i].length; j++) {
System.out.println(names[i][j]);
}
System.out.println();
} } }
2015-05-09