Declarations and Access Control Logic

© examsiri.com
Question : 20 of 29
 
Marks: +1, -0
Given:
1. public class Test {
2.   public enum Dogs {collie, harrier};
3.   public static void main(String [] args) {
4.    Dogs myDog = Dogs.collie;
5.    switch (myDog) {
6.     case collie:
7.     System.out.print("collie ");
8.     case harrier:
9.     System.out.print("harrier ");
10.    }
11.   }
12. }

What is the result?
Go to Question: