Multiple Choice Question

Quiz Guidelines

 

QID: 
475
Question: 

What is the effect of compiling and running the code shown in exhibit?

public class TestClass{
   public static void main (String args []){
      int sum = 0;
      for (int i = 0, j = 10; sum > 20; ++i, --j)      // 1
      {
         sum = sum+ i + j;
      }
      System.out.println("Sum = " + sum);
   }
}

Select 1 option

A. Compile time error at line 1.
B. It will print Sum = 0 
C. It will print Sum = 20
D. Runtime error. 
E. None of the above.

Q&A Set: 

Search the Web

Custom Search

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