What is the output of the following Java program no. 3?
- class Test
- {
- public static void main (String args[])
- {
- for(int i=0; 0; i++)
- {
- System.out.println(“Hello Javatpoint”);
- }
- }
- }
The above code will give the compile-time error because the for loop demands a boolean value in the second part and we are providing an integer value, i.e., 0.
Recent Posts