Skip to main content

Posts

Showing posts with the label java abstract class

Abstract class-1

Abstract class:- abstract is a  modifier used for class and methods, abstract modifier is used for class than that class must be inherit by other class otherwise that class will be useless and nobody can create object of abstract class directly but we can create object of sub class of abstract class. Abstract modifier is used on methods, those methods called abstract methods. An abstract method shows only requirement specification only and implementation provided by sub class of abstract class, if sub class not provides implementation of abstract methods than that sub class must be declared as an abstract. Abstract class can contains both concrete methods as well as abstract methods. But normal class or non abstract class cannot contain abstract methods. If any class is declared as an abstract than that class not compulsorily contains abstract methods but if any class contains abstract methods that class must be declared with abstract modifier. 1)    Abstract cl...