Tag Archives: inheritance

(Java) Java inheritance example

This example demonstrates advanced object-oriented concepts including inheritance, getters/setters, method overloading and reflection.

Posted in Java | Also tagged , , , , , | Leave a comment

Classes and inheritance in F#

This example is similar to the Classes in Ruby example. It demonstrates a superclass for representing a car. Two subclasses are used for representing a hero car and a villain car, they inherit from the superclass.

Posted in F# | Also tagged , , , , , , , , , , | Leave a comment

Classes and inheritance in Python

This example is similar to the Inheritance in PHP snippet. Python is used instead of PHP.

Posted in Python | Also tagged , , , , , , , | Leave a comment

Classes in Ruby

Ruby is an object-oriented programming language. This example demonstrates a superclass for representing a car. Two subclasses are used for representing a hero car and a villain car, they inherit from the superclass.

Posted in Ruby | Also tagged , , , , , , | Leave a comment

Inheritance in PHP

Classes can contain subclasses and subclasses can in turn contain superclasses. For example, the class Person could be the superclass of the class PizzaDeliveryGuy.

Posted in PHP | Also tagged , , , , , , , , , , , | Leave a comment