java£ºµÝ¹éººÂÞËþÓÎÏ·×îÉÙµÄ×ß·¨
package game;
public class HanTaGame {
public static void main(String[] args) {
fun('1', '2', '3', 2);
}
// ººËþÓÎÏ·½â¾ö·½°¸
public static void fun(char src, char idle, char dest, int n) {
if (1 == n) {
System.out.println(src + "--->" + dest);
return;
}
//¶¨ÒåÒ»¸ö˳Ðò
fun(src, dest, idle, n - 1);
System.out.println(src + "--->" + dest);
//½øÐÐ˳ÐòµÄ½»»»
fun(idle, src, dest, n - 1);
}
}
Ïà¹ØÎĵµ£º
package arrays.myArray;
public class BinaryTree {
private Node root;
// Ìí¼ÓÊý¾Ý
public void add(int data) {
// µÝ¹éµ÷ÓÃ
if (null == root)
root = new Node(data, null, null);
else
addTree(root, data);
......
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() {
......
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 ......
JavaÊý¾ÝÀàÐÍÓëת»»
JavaÊý¾ÝÀàÐÍ·ÖΪÈý´óÀà
²¼¶ûÐÍ£¬×Ö·ûÐÍ(char)£¬ÊýÖµÐÍ(ÕûÊý,¸¡µãÐÍ)
ÕûÊýÀàÐÍÓУºbyte(8bits)¡¢short(16bits)¡¢int(32bits)¡¢long(64bits)¡¢
¸¡µãÀàÐÍÓУºµ¥¾«¶È£¨32bits float£©¡¢Ë«¾«¶È£¨64bits double£©
booleanÀàÐͱäÁ¿µÄȡֵÓУºture¡¢false
charÊý¾ÝÀàÐÍÓУºunicode×Ö·û,16λ
Êý¾ÝÀàÐÍת» ......