Select the correct statement(s) based on the following code:
enum Command { /* w w w . jav a 2s. c om*/ ASSERT(1.4), // line1 DO, IF, WHILE; // line2 double version = 1.0; // line3 Command() { // constructor 1 this.version = 1.0; // constructor 1 } // constructor 1 Command(double version) { // constructor 2 this.version = version; // constructor 2 } // constructor 2 public static void main(String args[]) { Command[] commands = Command.values(); for (Command val:commands) System.out.println(val); } }
e
The code compiles successfully.
An enum can define and use multiple constructors.
The declaration of enum constants must follow the opening brace of the enum declaration.
It can't follow the definition of variables or methods.