标签:java rgs post target 数据 ring .net 小游戏 system
package day06; //方法的演示 public class MethodDemo { public static void main(String[] args) { //say(); //sayHi(); //编译错误,必须传參数 //sayHi(8); //编译错误,參数类型不匹配 //sayHi("zhangsan"); //String name="zhangsan" //sayHi("lisi"); //String name="lisi" //sayHi("wangwu"); //String name="wangwu" //int num = getNum(); //System.out.println(num); //88 //double d = plus(5,6); //double num1=5,double num2=6 //System.out.println(d); //11 //double a = 5.5; //double b = 4.4; //double dou = plus(a,b); //double num1=5.5,double num2=4.4 //System.out.println(dou); a(); //方法的嵌套调用 System.out.println("over"); } public static void a(){ System.out.println(111); b(); System.out.println(222); } public static void b(){ System.out.println(333); c(); } public static void c(){ System.out.println(444); } //有參有返回值 public static double plus(double num1,double num2){ //double num = num1+num2; //return num; //返回的不是num,而是num里面那个数 return num1+num2; //返回的是num1+num2的值 } //无參有返回值 public static int getNum(){ //return; //编译错误。必须返回一个值 //return 5.55; //编译错误,返回值类型不匹配 return 88; //1.结束方法的运行 2.返回结果(250)给调用方 } //有參无返回值 public static void sayHi(String name){ System.out.println("大家好,我叫"+name); return; //1.结束方法的运行 } //无參无返回值 public static void say(){ System.out.println("大家好,我叫WKJ"); } }
标签:java rgs post target 数据 ring .net 小游戏 system
原文地址:http://www.cnblogs.com/yfceshi/p/7242974.html