The below program demonstrates how to create non-static inner class in java. In the below program, class LifeBenefit is a innerclass to class LifePolicy . Run It Now!
Outputs the first n numbers from the Fibonacci sequence (or the n-th term simply -- to be decided by the user). The user can also choose 1 of 3 different algorithms for the program to use.