Show Table of Contents
Chapter 21. Fibonacci Example
21.1. Fibonacci Example: The Class
public static class Fibonacci {
private int sequence;
private long value;
public Fibonacci( final int sequence ) {
this.sequence = sequence;
this.value = -1;
}
... setters and getters go here...
}- The sequence field is used to indicate the position of the object in the Fibonacci number sequence.
- The value field shows the value of that Fibonacci object for that sequence position, using -1 to indicate a value that still needs to be computed.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.