package method;
public class Demo4 {
public static void main(String[] args) {
Demo4 d= new Demo4();
d.test(1,2,3,4);
}
public void test(int... i){
System.out.println(i[2]);
}
}
package method;
public class Demo5 {
public static void main(String[] args){
Demo5 test=new Demo5();
test.test();
}
public void test(){
test();
}
}
package method;
public class Demo6 {
public static void main(String[] args){
System.out.println(f(7));
}
//n的阶层
public static int f(int n) {
if(n==1){
return 1;
}else{
return n*f(n-1);
}
}
}
原创文章,作者:端木书台,如若转载,请注明出处:https://blog.ytso.com/244744.html