Introduction to OOP Chapter 17: The Polymorphic Variable : next previous audio real text

Self and Super

In Java and Smalltalk there is another pseudo-variable, named super.

Super is like self, only when a message is given to super it looks for the method in the parent class of the current class.

class Parent {
	void exampleOne () {
		System.out.println("In parent method"); 
	}
}

class Child extends Parent {
	void exampleOne () {
		System.out.println("In child method");
		super.exampleOne();
	}
}
Variable is called base in C#.
Intro OOP, Chapter 17, Slide 06