R
Q. What is the output of the below Java program with Enums?
enum Bus { DIESEL, ELECTRIC, HYBRID int mileage = 10; } public class EnumTest2 { public static void main(String[] args) { Bus bus = Bus.ELECTRIC; System.out.println(bus + ", " + bus.mileage); } }
No solution found for this question.
Add Solution and get +2 points.
You must be Logged in to update hint/solution
Be the first to start discuss.
Q. Which of the following method is not belonging to the String class?
Q. What is the output of the Java code snippet below?
Q. What is a parameterized constructor in Java?
Q. Which of the following is an exception thrown by the methods of the class String?
Q. Iterator returned by HashSet is
Q. What is the output of the Java code snippet?
Q. What is the output of the following program?
Discusssion
Login to discuss.