Problem:
How to use foreach loop (enhanced for) that came with Java 5?
How to use foreach loop (enhanced for) that came with Java 5?
Java has very flexible literals for expressing different kinds of numbers. In this post we’ll go through all Java Literals one by one.
What are Java List types? What are their methods and what are their properties?
How to write Fizz Buzz in Java?
The problem is as follows:
Write a program that prints the numbers from 1 to 100. But for multiples of three print ‘Fizz’ instead of the number and for the multiples of five print ‘Buzz’. For numbers which are multiples of both three and five print ‘FizzBuzz’.
It’s a very common task on job interviews.