Fibonacci Series In Java
class Fibonacci { public static void main(String args[]) { int a=1,b=1,c; System.out.println(+a); System.out.println(+b); for(int i=1;i<=10;i++) { c=a+b; System.out.println(+c); a=b; b=c; } } } Output: 1 1 2 3 5…
class Fibonacci { public static void main(String args[]) { int a=1,b=1,c; System.out.println(+a); System.out.println(+b); for(int i=1;i<=10;i++) { c=a+b; System.out.println(+c); a=b; b=c; } } } Output: 1 1 2 3 5…
When a function with the same name and in the base and derived class is there then the base class function will be overridden(Means Ignored. Example of Method Overriding: class…