Multiple Choice Question

Quiz Guidelines

 

QID: 
470
Question: 

What will the following code print when compiled and run

public class TestClass {
      public static void main(String[] args){
            while(int k = 5; k<7){ 
                  System.out.println(k++);
            }
      }
}

Select 1 option

A. 5
6
B. 5
6
7
C. It will keep printing 5.
D. It will not compile.
E. It will throw an exception at run time.

Q&A Set: 

Search the Web

Custom Search

Searches whole web. Use the search in the right sidebar to search only within javajee.com!!!