Answers for "when to use abstract class and interface in java with real time example"

0

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();
   }
}
Posted by: Guest on November-10-2020
1

abstract classes and interfaces in java

abstract class have no implementation of methods functions inside it. the classes which extending abstract class have to implement it
Posted by: Guest on December-30-2020

Code answers related to "when to use abstract class and interface in java with real time example"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language