Basically, Fibonacci will help you to provide a sequence that will be the sum of the previous two elements. You can understand it from the below example:

fibonacci(5) = fibonacci(4) + fibonacci(3)

fibonacci(3) = fibonacci(2) + fibonacci(1)

I hope this will help.

Want to become a Java Expert? Join Java Certification now!!

Want to know more about Java? Watch this video on Java Tutorial for Beginners | Java Tutorial: