Posts

Showing posts with the label abstract class in java with example

abstract class in java with example

An abstract class is a class, that is declared as abstract. Abstract class contains 0 or more abstract methods. Abstract classes can not be instantiated but that can be sub classed.           An abstract method is a methods that is declared without any implementation. Like this, 1 2 3 abstract class Car { abstract void show (); }           •    A class with abstract methods is called abstract class. The both abstract method and abstract class must be declared with abstract.           •   In case where you want to use implementation inheritance then it is usually provided by an abstract base class. Abstract classes are excellent candidates inside of application frameworks.           •    Abstract classes let you define some default behavior and force sub-classes to provide any specific be...