Paste
Copy
Cut
Options

¡Tu solución está lista!

Nuestra ayuda de expertos desglosó tu problema en una solución confiable y fácil de entender.

Mira la respuesta
  • Pregunta: 21.What is the output of the below Java program with multiple abstract classes? abstract class Editor { abstract void show(); } abstract class Author extends Editor { abstract void print(); } class Office extends Author { void show() { System.out.println("Editor method"); } void print() { System.out.println("Author method"); } } public

    21.What is the output of the below Java program with multiple abstract classes? abstract class Editor { abstract void show(); } abstract class Author extends Editor { abstract void print(); } class Office extends Author { void show() { System.out.println("Editor method"); } void print() { System.out.println("Author method"); } } public class AbstractClassTesting4 { public static void main(String[] args) { Editor ed = new Office(); ed.show(); Author au = new Office(); au.print(); } } A) Editor method Editor method B) Author method Author method C) Editor method Author method D)Compiler error 22.20) An abstract class can define ____ inside of it. A)Inner abstract class B)Inner concrete class C)static methods D)All the above

    23.What is the output of the below Java program with Method Overriding? class Bus { void seatingCapacity() { System.out.println("Superclass Seats=32"); } } class ElectricBus extends Bus { void seatingCapacity() { System.out.println("Subclass Seats=20"); } void showInfo() { seatingCapacity(); this.seatingCapacity(); } } public class MethodOverriding1 { public static void main(String[] args) { ElectricBus eb = new ElectricBus(); eb.showInfo(); } } A) Subclass Seats=20 Superclass Seats=32 B) Superclass Seats=32 Subclass Seats=20 C) Superclass Seats=32 Superclass Seats=32 D) Subclass Seats=20 Subclass Seats=20

    24.Find Superclass and Subclass in the below Java code snippet? class B { void show(){} } class A { void hide(){} } A)B is superclass and A is subclass. B)There is no superclass or subclass present. C)A is superclass and B is a subclass. D)B is an abstract class.

    25.What is the output of the below java program with Constructors and Inheritance? class Processor { Processor() { System.out.print("Inside Processor() Constructor. "); } } class I3Processor extends Processor { I3Processor() { System.out.print("Inside I3Processor() Constructor. "); } } class I5Processor extends I3Processor { I5Processor() { System.out.print("Inside I5Processor() Constructor. "); } } public class JavaInheritance2 { public static void main(String[] args) { I5Processor i5 = new I5Processor(); } } A)Inside I5Processor() Constructor. Inside I3Processor() Constructor. Inside Processor() Constructor. B)Inside I5Processor() Constructor. Inside I5Processor() Constructor. Inside I5Processor() Constructor. C)Inside Processor() Constructor. Inside I3Processor() Constructor. Inside I5Processor() Constructor. D)Inside Processor() Constructor. Inside IPProcessor() Constructor. Inside IPProcessor() Constructor.

  • Chegg Logo
    Intenta enfocarte en un paso a la vez. ¡Tú puedes!
    Solución
    Paso 1

    21. Correct answer: C

    Explanation:

    The program will compile and run without any errors. The output will be:

    Editor ...

    Mira la respuesta completa
    answer image blur
    Paso 2
    Desbloquea
    Paso 3
    Desbloquea
    Paso 4
    Desbloquea
    Paso 5
    Desbloquea
    Respuesta
    Desbloquea