Assuming the following enum declaration exists: enum Dog { POODLE, BOXER, TERRIER } What will the following statements display? a. System.out.println(Dog.POODLE + "\n" + Dog.BOXER + "\n" +...



Assuming the following enum declaration exists:


enum Dog { POODLE, BOXER, TERRIER }



What will the following statements display?


a. System.out.println(Dog.POODLE + "\n"



+ Dog.BOXER + "\n"



+ Dog.TERRIER);


b. System.out.println(Dog.POODLE.ordinal() + "\n"



+ Dog.BOXER.ordinal() + "\n"



+ Dog.TERRIER.ordinal());


c. Dog myDog = Dog.BOXER;



if (myDog.compareTo(Dog.TERRIER) > 0)



System.out.println(myDog + " is greater than "



+ Dog.TERRIER);



else



System.out.println(myDog + " is NOT greater than "



+ Dog.TERRIER);

Nov 21, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here