Solutions for top 50 Java interview questions.
Write a short program that prints each number from 1 to 100 on a new line.For each multiple of 3, print "Fizz" instead of the number.For each multiple of 5, print "Buzz" instead of the number.For numbers which are multiples of both 3 and 5, print "FizzBuzz" instead of the number.
Write a program to calculate and print Fibonacci number using both recursion and Iteration.
Write a program to reverse a string since there is no utility method in the String class.
For e.g reverse of string "happy" is "yppah"
Write a Java program to check if a given number is prime or not. Remember, a prime number is a number which is not divisible by any other number, e.g. 3, 5, 7, 11, 13, 17, etc. Be prepared for cross, e.g. checking till the square root of a number, etc.