public static void main(String args[]) { String str = "2"; System.out.println("--"+str + ' ' + "--"); int a = 2+' '; System.out.println("--"+a+"--"); } 大家检阅一下,有什么区别
public class HelloWorld{ public static void main(String [] args) { System.out.println("Hello LZ!"); } }
public class Fantacy{ public static void main(String args[]){ hello(); } public static void hello(){ hello(); } }
public class Parade{ public static void main(String args[]){ helloComrades(); } public static void helloComrades(){ System.out.println("Hello Comrades! You have worked hard!"); helloPresident(); } public static void helloPresident(){ System.out.println("Hello President! Serve the people!"); helloComrades(); } }输出: 同志们好!同志们辛苦了! 首长好!为人民服务!
public static void main(String args[]) {
String str = "2";
System.out.println("--"+str + ' ' + "--");
int a = 2+' ';
System.out.println("--"+a+"--");
}
大家检阅一下,有什么区别
public class HelloWorld{
public static void main(String [] args)
{
System.out.println("Hello LZ!");
}
}
public class Fantacy{
public static void main(String args[]){
hello();
} public static void hello(){
hello();
}
}
public class Parade{
public static void main(String args[]){
helloComrades();
} public static void helloComrades(){
System.out.println("Hello Comrades! You have worked hard!");
helloPresident();
} public static void helloPresident(){
System.out.println("Hello President! Serve the people!");
helloComrades();
}
}输出:
同志们好!同志们辛苦了!
首长好!为人民服务!