Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
I'm attempting to produce a Fibonacci series of initial ten elements utilizing recursion. However, the compiler gives an error. Kindly assist me with tracking down the specific arrangement.
The program is given below:
public class DemoJava { int a=0, b=1, c=0, count=10; public void fibonacciRecursion(count) { if(count>0){ c = a+b; a = b; b = c; System.out.println(c); fibonacciRecursion(count-1); } } public static void main(String args[]){ System.out.println("This is a Demo Program."); System.out.println(a); System.out.println(b); DemoJava dj = new DemoJava(); dj.fibonacciRecursion((count-2)); } }
I have also read a couple of resources on the fibonacci series on the wiki, scaler and Quora to understand the topic in a better way. kindly help!
Solved! Go to Solution.
Could you give us a little more context around this issue? Are you trying to write a ThingWorx extension in Java? Or are you trying to write a JavaScript service in the Composer?
Thanks,
Nick
Could you give us a little more context around this issue? Are you trying to write a ThingWorx extension in Java? Or are you trying to write a JavaScript service in the Composer?
Thanks,
Nick