Skip to content

Instantly share code, notes, and snippets.

@DavidMah
Created February 25, 2013 23:48
Show Gist options
  • Select an option

  • Save DavidMah/5034451 to your computer and use it in GitHub Desktop.

Select an option

Save DavidMah/5034451 to your computer and use it in GitHub Desktop.
public class FibonacciGenerator {
int previous = 0
int current = 1
public int nextNumber() {
int value = current;
current = previous + current;
previous = current;
return previous;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment