What is the result?
A.
Cue sports, Cue sports
B.
Compilation fails at line 9
C.
Compilation fails at line 11
D.
Compilation fails at line 12
E.
Compilation fails at line 13
Explanation:
Class Snooker is public. Should be declared in a separate file. // Line 9
getCategory() >>> GetCategory() Line 13
B, if the file name is “CueSports.java”.
E >> “GetCategory()” method is unknown and the abtract method “getCategory();” of interface is already implemented in super class of Snooker namely in CueSports.
If line 13’s obj1.GetCategory() is correctly written as obj1.getCategory(), the code compiles with no problem and output the answer in A.
Negative.
Two public class cannot be in the same file.
Thus, B is the right one.