Java语法
- 标识符,关键字,常量,变量(scope,block)
- 数据类型-基本数据,引用数据(class,interface,array)
PS:Boolean取值true/false,区别于C语言0/非0
PPS:char可十六进制编码形式表示
- 运算符&表达式-逻辑(异或^),字符串连接符(+),位运算
- 语句-switch语句只能int型
- 递归调用-迭代
例1-阶乘n!
/*阶乘factorial*/
package factorial;
public class FactorialTest {
public static void main(String arg[]) {
System.out.println(method(5));//求5*4*3*2*1
}
public static int method(int n) {
if(n==1) return 1;
else return n*method(n-1);
}
}

例2-Fibonacci数列