易截截图软件、单文件、免安装、纯绿色、仅160KB

java:递归:10的阶乘

package game;
public class JieCeng {
 public static void main(String[] args){
  System.out.println(fun(10));
 }
 
 public static int fun(int n){
  if(1==n)
   return 1;
  System.out.println( n * fun(n-1));
  return n * fun(n-1);
 }
}


相关文档:

java:手写MyArrayLisy的常用方法,增删改查

package arrays.myArray;
public class MyArrayList {
 private Object[] arrObj = new Object[3];
 private int size = 0;
 
 // 长度
 public int size() {
  return size;
 }
 // insert
 public void add(Object obj) {
  add(size,obj);
&nb ......

java:ArrayList循环遍历的俩种方法使用

package collection;
import java.util.*;
public class NewArrayList {
 public static void main(String[] args) {
  List<Student> students = new ArrayList<Student>();
  for (int i = 0; i < 6; i++) {
   students.add(new Student("Happy"+i,"male" ......

java:Set循环遍历的俩种方法使用

package collection;
import java.util.*;
public class NewSet {
 public static void main(String[] args) {
  Set<Student> students = new HashSet<Student>();
  for (int i = 0; i < 6; i++) {
   students.add(new Student("Happy"+i,"male"+i,20+i)) ......

java:Student类

package collection;
public class Student {
 
 public Student() {}
  
 public Student(String name, String sex, int age) {
  this.name = name;
  this.sex = sex;
  this.age = age;
 }
 @Override
 public String toString() { ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号