Presentation
Presented by:
Ghazanfar Ali (FA15-BEE-012)
Topic:
Abstract Class and Concrete Class
Contents:
 Abstract Class
Abstract Class Program
 Concrete Class
Concrete Class Program
 Relation between Abstract Class and Concrete Class
 Program output
Abstract Class
 Abstract class is just like other classes but it marks with abstract
keyword.
 Classes that contain one or more abstract methods
 An abstract method is that which is declared but contains no
implementation.
 A method can be made abstract if we add the keyword “abstract”
to it
 Abstract classes may not be instantiated, and require subclasses to
provide implementations for the abstract methods
 These subclasses are also known as child class or derived class.
 Now here is a simple program of an Abstract class
Abstract Class Program
Why we use abstract class?
 The purpose of an abstract class is to provide a common
definition of a base class that multiple derived classes can
share.
 For example; we were modeling the behavior of animals.
Animals are capable of doing different things. Some
common operations are performed by all animals, but in a
different way as well as like the sounds they make.
 And we can simply do this by overriding.
Concrete Class
 Default class in java
 A derived class that provides the basic implementations for all of
the methods that are not already implemented in the base class.
 The concrete class is the implementation of an abstract class
methods.
 We can also call concrete methods of abstract class in concrete
class objects.
Concrete Class Program
Why we use Concrete Class?
 The implementation of an Abstract class.
 In concrete class (child or derived class) you can
call the methods of abstract class by overriding the
methods of abstract class and then in main method
we call the objects of concrete class which gives us
the implementation of abstract class.
Test Class
Output
Relation Between Abstract and Concrete Class
 So
Parent Class
Child Class
Abstract Class Presentation

Abstract Class Presentation

  • 1.
    Presentation Presented by: Ghazanfar Ali(FA15-BEE-012) Topic: Abstract Class and Concrete Class
  • 2.
    Contents:  Abstract Class AbstractClass Program  Concrete Class Concrete Class Program  Relation between Abstract Class and Concrete Class  Program output
  • 3.
    Abstract Class  Abstractclass is just like other classes but it marks with abstract keyword.  Classes that contain one or more abstract methods  An abstract method is that which is declared but contains no implementation.  A method can be made abstract if we add the keyword “abstract” to it  Abstract classes may not be instantiated, and require subclasses to provide implementations for the abstract methods  These subclasses are also known as child class or derived class.  Now here is a simple program of an Abstract class
  • 4.
  • 5.
    Why we useabstract class?  The purpose of an abstract class is to provide a common definition of a base class that multiple derived classes can share.  For example; we were modeling the behavior of animals. Animals are capable of doing different things. Some common operations are performed by all animals, but in a different way as well as like the sounds they make.  And we can simply do this by overriding.
  • 6.
    Concrete Class  Defaultclass in java  A derived class that provides the basic implementations for all of the methods that are not already implemented in the base class.  The concrete class is the implementation of an abstract class methods.  We can also call concrete methods of abstract class in concrete class objects.
  • 7.
  • 8.
    Why we useConcrete Class?  The implementation of an Abstract class.  In concrete class (child or derived class) you can call the methods of abstract class by overriding the methods of abstract class and then in main method we call the objects of concrete class which gives us the implementation of abstract class.
  • 9.
  • 10.
  • 11.
    Relation Between Abstractand Concrete Class  So Parent Class Child Class