FileDocCategorySizeDatePackage
PipedStreamTest.javaAPI DocAndroid 1.5 API8689Wed May 06 22:42:02 BST 2009android.core

Fibonacci

public class Fibonacci extends Object

Fields Summary
int
n1
int
n2
Constructors Summary
Methods Summary
public intnext()


       
        if (n1 < 0) {
            n1 = 0;
            return 0;
        } else if (n1 == 0) {
            n2 = 0;
            n1 = 1;
            return 1;
        } else {
            int ret = n1 + n2;
            n2 = n1;
            n1 = ret;
            return ret;
        }