Complete the code to declare an abstract method in an abstract class.
abstract class Animal { abstract void [1](); }
The method name must be provided after the abstract keyword and return type. Here, makeSound is the method name.
Complete the code to make the class abstract.
public abstract class [1] { abstract void display(); }
To declare an abstract class, the keyword abstract must come before the class name.
Fix the error in the abstract method declaration.
abstract class Vehicle { [1] void move(); }
An abstract method must be declared with the abstract keyword and cannot have a body (no braces {}).
Fill both blanks to correctly declare an abstract method in an abstract class.
abstract class Shape { [1] [2] area(); }
The method must be declared as abstract and have a return type. Here, double is the return type for the method area.
Fill all three blanks to correctly declare an abstract method with public access and int return type.
abstract class Calculator { [1] [2] [3](); }
The method must be declared with the access modifier public, the keyword abstract, and a method name, here calculate, with return type int.