Java Inheritance, Polymorphism, Abstraction and Encapsulation

Java Inheritance, Polymorphism, Abstraction and Encapsulation


  • Java Classes - Normally have relationship with other classes and contain methods
  • Accessors - Are methods that are used to access information from the class (getter).
  • Mutators - Are methods that manipulate data within the class (setter)
  • Inheritance - Is a relationship were one class inherits attributes and/or behaviors from another class.

Java Class examples

  • Encapsulation - AKA Data hiding, encapsulation is like a protective barrier protecting the code from other code from outside the class.

Encapsulation explained




    Jave simple Polymorphism example
  • Polymorphism - Allows  the object to take many forms, a example would be a child class refers to parent class.



  • Abstraction - The ability to make a class abstract in OOP, an abstract class can not be instatiated.



No comments:

Post a Comment