Home Tutorial Java Scjp Part1 SCJP Module-1 Question-14

 
 

SCJP Module-1 Question-14
Posted on: July 8, 2010 at 12:00 AM
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)

Related Tags for SCJP Module-1 Question-14:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.