SCJP Module-1 Question-14


 

SCJP Module-1 Question-14

This program checks your knowledge of Java program and also prepare you for SCJP examination.

This program checks your knowledge of Java program and also prepare you for SCJP examination.

Given a sample code:

1 class ListState {
2 public enum State{DELHI, MUMBAI, MADRAS}
}

3 public class Sample4 {
4 public static void main(String args[]) {
5  // Place the statement here
}}

What statement you place at line number 5 for successful compilation and execution of above code?

(1)    ListState state = ListState.DELHI;

(2)    ListState.State state = ListState.State.MADRAS;

(3)    ListState state = MUMBAI;

(4)    ListState state = ListState.MUMBAI;

Answer

(2)

Ads