Comment on Tutorial - Method Overriding in Java By Henry
Comment Added by : sam
Comment Added at : 2011-06-24 15:13:34
Comment on Tutorial : Method Overriding in Java By Henry
using a same name ,return type and parameter type for a method in a derived class as that of a method i.e, present in the base class is known as method overridind
class y extends x
void show()//notice void show ()is present in both the base class and the derived class//
public static void main(string n)
y y1=new y();//y1....derived class object//
though it`s possible to invoke the base class method within the derived class object.
When the statement y1.show();is exicuted,the show() of Derived class(i.e,y) is invoked reasulting in the out put 'hello'.
the base class method show() is said to be hidden from the derived class method show(). In order to exicute show()of the base class therre are twomethods
1. By creating an object for th base class.
2. By using super keyword
- Data Science
- Cloud Computing
- Java Beans
- Mac OS X
- Office 365
- Tech Reviews
Subscribe to Tutorials
4. it is very good for best practice of basics.......
View Tutorial By: sushil ghimire at 2015-03-01 13:27:57
5. Hi there, a nice tutorial. i wanna ask, what about
View Tutorial By: Alfa at 2013-03-06 04:04:26
6. that was gud example to explain abstract. i have d
View Tutorial By: zishan at 2010-05-20 00:21:46