Multiple Choice Question

Quiz Guidelines

 

QID: 
66
Tags: 
Question: 

Consider the following code appearing in a file named TestClass.java:

class Test{ }  // 1
public class TestClass {
   public int main(String[] args)  { // 2
       double x=10, double y;  // 3
       System.out.println[]; // 4
       
        for(int k =0; k<x; k++){ } 
        
       return 0;
   }
}

Which of the lines are invalid?

Select 1 option

A. // 1 and // 4
B. // 3 and // 4 
C. // 2 and // 4 
D. // 2 and // 3

Q&A Set: