Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



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

Answer / neema

If we have same method name in the super class as well as
in the sub class, then the method in the subclass is said
to override the method in the super class.

Is This Answer Correct ?    25 Yes 4 No

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

Answer / ramana

override methos have same method name with same
signature.which methods are apper in super class to sub
class.

Is This Answer Correct ?    14 Yes 2 No

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

Answer / vikas

Overriding means, In a derived class, if we include same
method name, with same number & types of parameters and
return type as a method already defined in the base class,
then the method is said to be Overridden.

base class:

class Circle {
protected double radius;

public double getArea() {
return Math.PI*radius*radius;
}//this method returns the area of the circle
}

derived class:

class Cylinder extends Circle {

protected double length;

public double getArea() { // method overriden here
return 2*super.getArea()+2*Math.PI*radius*length;
}//this method returns the cylinder surface area
}

Is This Answer Correct ?    7 Yes 1 No

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

Answer / 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

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

Answer / rishi

Whenever we use same mathod with the same signature that we
call mathod overloding and we use it, when we use
inharitence or abstract class.

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More Core Java Interview Questions

How to change the priority of thread or how to set the priority of thread?

0 Answers  


What are facelets templates?

0 Answers  


Describe the various concepts related to object oriented programming (oop).

0 Answers  


while creating thread why we extend thread class

2 Answers  


In java how do we copy objects?

0 Answers  


How can we make a class singleton?

0 Answers  


Explain different ways of creating a thread?

0 Answers  


What is public static?

0 Answers  


How much ram can a 64 bit processor theoretically?

0 Answers  


Explain 5 io best practices?

0 Answers  


I want to run a simple hello world java (HelloWorld.java) program using a batch file. How can i run it and how to construct a batch file.

1 Answers   Infosys,


How do you create an array in java?

0 Answers  


Categories