Java example: hello world and fibonacci

Run a Java program that prints Hello World and computes Fibonacci numbers.

A minimal Java program with a public class Main and a public static void main entry point. It prints a greeting with System.out.println, then loops from 0 to 9 printing each Fibonacci number. The static fib method returns a long and is implemented recursively, returning n for the base case or the sum of the two previous values otherwise.

Output

Errors