Computer Science, asked by aadityavyas6608, 1 year ago

Which of the following declares an abstract method in an abstract Java class?
A.public abstract method();
B.public abstract void method();
C.public void abstract Method();
D.public void method() {}

Answers

Answered by afruja70
5
Hello mate

here's your answer

¤¤¤¤¤¤¤¤¤¤¤¤¤

Option B✔✔

Public abstract void method.

¤¤¤¤¤¤¤¤¤¤¤¤

Hope it helps you
Answered by sarahssynergy
2

The correct answer is option (B.) public abstract void method();

  • public abstract void method(); declares an abstract method in an abstract Java class.
  • A method without body (no implementation) is known as abstract method.
  • A method must always be declared in an abstract class, or in other words you can say that if a class has an abstract method, it should be declared abstract as well.
  • public abstract class GraphicObject { // declare fields // declare nonabstract methods abstract void draw(); }.
Similar questions