Question: What is not a key advantage of using an enum as below have versus using a string for myCar and string literals like red, green,

What is not a key advantage of using an enum as below have versus using a string for myCar and string literals like "red", "green", and "black"?
public enum CarColor {RED, GREEN, BLACK}
CarColor myCar;
myCar = CarColor.GREEN;
if (myCar == CarColor.GREEN){
System.out.print("Green is our most popular color");
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!