A method which is declared as abstract and does not have implementation is known as an _____________? A. Abstract Interface B. Abstract Thread C. Abstract List D. abstract Method code example

Example 1: is it necessary for abstract class to have abstract method

No, abstract class can have zero abstract methods.

Example 2: can abstract class have non abstract methods in java

abstract class AbstractDemo { // Abstract class
   private int i = 0;
   public void display() { // non-abstract method
      System.out.print("Welcome to Tutorials Point");
   }
}
public class InheritedClassDemo extends AbstractDemo {
   public static void main(String args[]) {
      AbstractDemo demo = new InheritedClassDemo();
      demo.display();
   }
}

Tags:

Misc Example