Tag: inheritance

Simple inheritance in C#

In the following code we present a simplest example of inheritance in C#. The class BaseClass is the parent class from which a child class ChildClass is derived using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Drawing; namespace ConsoleApplication6 { class BaseClass { public void MyMethod() { Console.WriteLine("This is base class method");

object oriented Inheritance in php

We can use Objected Oriented Programming model in PHP which has rich set of features. Here an example of inheritance in PHP is presented: <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body> <?php class ParentClass { function ShowInParent() { echo "This is in Parent Class<br>"; } } class MyClass extends ParentClass { function