Skip to content
the poor coder

Hackerrank Java Method Overriding 2 (Super Keyword) Solution

Poor Man
Published
Updated
Reading time
1 min read

When a method in a subclass overrides a method in superclass, it is still possible to call the overridden method using super keyword. If you write super.func() to call the function func(), it will call the method that was defined in the superclass.

You are given a partially completed code in the editor. Modify the code so that the code prints the following text:

Text
Hello I am a motorcycle, I am a cycle with an engine.
My ancestor is a cycle who is a vehicle with pedals.

Solution in java8#

Python
		String temp=super.define_me(); 

Keep going

ESC