Answers for "Can there be an abstract method without an abstract class?"

0

can we have abstract class having no abstract method 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();
   }
}
Posted by: Guest on November-10-2020
0

Is it mandatory for an abstract class to have abstract methods?

No, abstract class can have zero abstract methods.
Posted by: Guest on November-28-2020
0

can you declare an abstract method in a non abstract class

No. A normal class(non-abstract class) cannot have abstract methods.
Posted by: Guest on November-14-2020

Code answers related to "Can there be an abstract method without an abstract class?"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language