Pillars of Object-Oriented Programming

  • Java.
  • JavaScript.
  • Python.
  • C++
  • Visual Basic . NET.
  • Ruby.
  • Scala.
  • PHP.
  • Public: A Public class can be access anywhere in the program.
  • Private: A Private class can only be accessed from within the same class where the Private is defined.
  • Protected: A Protected class acts as a middle ground. These can be accessed by any class it is defined, as well as subclasses of the class. Protected classes are private to the hierarchy it resides in
  • Dynamic polymorphism: occurs during the runtime of the program. This is created when a superclass and subclass share a methods name and parameters but have different implementation. In polymorphism the subclass method would override the superclass method of the same name. Which version of the method you run would depend on the level of the hierarchy you are in.
  • Static polymorphism: occurs during compile-time. This refers to multiple methods with the same name but different arguments are defined in the same class. This is also known as method overloading. The appropriate method would be called based on parameters are given to it.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Adam Adolfo

Adam Adolfo

Student at The Flatiron School in Washington DC