易截截图软件、单文件、免安装、纯绿色、仅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:Object对象进行排序

package arrays.compara;
import java.util.Arrays;
public class Student {
 public static void main(String[] args) {
  Stu[] stus = new Stu[]{
    new Stu(156,34,"ad"),
    new Stu(153,24,"cc"),
    new Stu(126,37,"ab"), ......

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:三种经典大排序汇总,冒泡,插入,选择

package arrays.myArray;
public class SortArr {
 public static void main(String[] args) {
  int[] arrInt = { 4, 7, 8, 5, 6, 3, 2, 3, 4 };
  maoPaoSort(arrInt);
  print("冒泡排序:", arrInt);
  arrInt = new int[]{ 4, 7, 8, 5, 6, 3, 2, 3, 4 };
 & ......

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:递归:汉罗塔游戏计算出最少的步数

package game;
public class HanTa {
 public static int i = 0;
 public static void main(String[] args){
  calc('A', 'B', 'C', 2);
  System.out.println("最少需要"+i+"步。");
 }
 
 //汉罗塔游戏计算
 public static void calc(char src, char ilde, c ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号