What is the result?

Given:

What is the result?

Given:

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



Leave a Reply 4

Your email address will not be published. Required fields are marked *


Tim

Tim

B, if the file name is “CueSports.java”.

mknet

mknet

E >> “GetCategory()” method is unknown and the abtract method “getCategory();” of interface is already implemented in super class of Snooker namely in CueSports.

test

test

If line 13’s obj1.GetCategory() is correctly written as obj1.getCategory(), the code compiles with no problem and output the answer in A.

KashiHide

KashiHide

Negative.
Two public class cannot be in the same file.
Thus, B is the right one.