Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

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();
   }
}
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #abstract #class #abstract #methods #java
ADD COMMENT
Topic
Name
8+6 =