public class DS1203 {public static void main (String() args) {circusPerformer iv
ID: 3820601 • Letter: P
Question
public class DS1203 {public static void main (String() args) {circusPerformer ivan = new circusPerformer ();}} interface CircusPerformer {public String getperformer (); public void act (); public void entrance (); public void performance (); public void exit ();} Which of the following are reason(s) why the program does not compile? I. CircusPerformer is abstract and cannot be used to instantiate an object. II. The CircusPerformer interface is not implemented by the required classes. III. There is no constructor defined in interface CircusPerformer. (A) I only (B) II only (C) III only (D) I and II only (E) I, II and IIIExplanation / Answer
Answer is (A).
CircusPerformer is abstract; cannot be instantiated
We can not instantiate an object of interfcae because it is abstract.
Though some implementation of CircusPerformer can be instantiated
for example
public class RingMaster implements CircusPerformer
{
....
// some code
}
then in main we can write
CircusPerformer ivan = new RingMaster();
Hope this helped.
Please leave a positive rating if this answered your question.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.