package feibonacci;
public class Feibonacci {
private int t1 = 1,t2 = 1;
private int s = 0;
System.out.print(t1+" "+t2+" ");/
/,报错,类中只能有成员变量和成员方法,不能直接调用
public Feibonacci (int mon){
System.out.print(t1+" "+t2+" ");
for(int i=0; i<mon-2; i++){
s = t1 + t2;
t1 = t2;
t2 = s;
System.out.print(s+" ");
}
}
public static void main(String[] args) {
// TODO 自动生成的方法存根
Feibonacci rabits = new Feibonacci(10);
}
}