Click here to Skip to main content
15,902,939 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a beginner question on Java Fibonacci.

In this java program, The method should prints fibonnacci numbers sequence from beginIndex to LastIndex, so it should print "Hi" (instead of number) if the number is multiples of 5, print "I am" if the number is multiples of 7 and print "Hi I am me" if the number is multiples of 7 and 5. I am not really sure on how to do this. Thank you for any help.

class FibonacciClass {
    public static void main(String args[] ) throws Exception {

        generatefibonacci(10, 20);
        generatefibonacci(0, 1);


    private static void generatefibonacci(int BeginIndex, int LastIndex) {


What I have tried:

I have tried the fibonacci sequence, but im not really sure how to replace the numbers with strings.
Updated 19-Aug-16 22:45pm
Patrice T 19-Aug-16 13:47pm    
You have done nothing. try to work and come back if you are stuck.

1 solution

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900