what is mean by overriding in which situation we wil use?

Answer Posted / shahbaz ali

According to J2ee Compleet reference java:
I Think the answer is that
Overriding means the : In inheritance If we Declare the
(Public of default) Method in the superclass Similarly we
declare the method with the same name ,Same type,same
number of parameters.but the Body of the method May
different When We Instansiate child class and access it
then child's method will called if u want to call super's
overriden method then use the [super()] method to access it
in child for this read [Java compleete reference's
Chapter#8] u will find reasonable answer

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we have multiple classes in single file ?

599


What is remote method invocation (rmi)?

611


What is difference between static and final?

556


worst case complexities of Quick sort and Merge sort.

599


How do you test a method for an exception using junit?

527






What do you understand by garbage collection in Java? Can it be forced to run?

550


What is Gang of four design patterns

590


Does a class inherit the constructors of its superclass in java programming?

522


What is static in java?

555


What are the main uses of this keyword?

597


When do we use synchronized methods in java?

582


How to make a class or a bean serializable?

537


which one is more efficient int x; 1. if(x==null) 2.if(null==x) state which one either 1 or 2?

9201


What is difference overloading and overriding?

579


Why wait and notify methods are declared in object class?

599