What is Overriding and how can it be used?

Answers were Sorted based on User's Feedback



What is Overriding and how can it be used?..

Answer / pranab dutta

If a class defines a method using the same name, return
type, and arguments in its super class, then it is called
Overriding. Methods are overridden to make them more
public. The method in the class overrides the method in the
super class.
When the method is invoked for an object of the class, it
is the new definition of the method that is called, and not
the method definition from super class.

Is This Answer Correct ?    46 Yes 6 No

What is Overriding and how can it be used?..

Answer / gopalramana

To define method in subclass having same method name as
method in superclass having same return type,same
parameters,then method in subclass should be override
method in superclass.

used in code repalcement.

Is This Answer Correct ?    17 Yes 5 No

What is Overriding and how can it be used?..

Answer / siddu

overriding is nothing to change behaviour of super class
method in subclass with same singature of method

Is This Answer Correct ?    8 Yes 0 No

What is Overriding and how can it be used?..

Answer / ashish sharma

overriding comes with two class ( base and drived class )

function in the base class is like

public virtual void Display();

function in the drived class is like

public override void Display();

this function overrides the base class .

Is This Answer Correct ?    9 Yes 2 No

What is Overriding and how can it be used?..

Answer / vikneswarank

the class and it sub contain one method with same name and
same signature and same return type also
sub class in method will override in super class.

in case of overridding during run time jvm knows which
method it will call.

Is This Answer Correct ?    9 Yes 3 No

What is Overriding and how can it be used?..

Answer / sajith

If class define method using same name,parameter,return
type,argument in its superclass then it is called overriding.
sub class should be override parentclass

Is This Answer Correct ?    9 Yes 5 No

What is Overriding and how can it be used?..

Answer / arvind wagh

Overriding means same name methods in different classes

When the method is invoked for an object
of the class, it is the new definition of the method that is
called, and not the method definition from super class

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More Core Java Interview Questions

Is null false in java?

0 Answers  


What is the difference between final, finally and finalize()?

0 Answers  


why java does not have operator overloading?

2 Answers  


Define Compiling?

3 Answers  


who can we create the object of a class? in how many ways we can create it (max 5)

2 Answers  






Is singleton thread safe in java?

0 Answers  


What is object english?

0 Answers  


What is json parser in java?

0 Answers  


What is anonymous inner class?

0 Answers  


What will be the output of the program? public class Test { public static void main(String args[]) { ArrayList<String> list = new ArrayList<String>(); list.add("2"); list.add("3"); list.add("4"); list.add("5"); System.out.println("size :"+list.size()); for(int i=0;i<list.size();i++) { list.remove(i); } System.out.println("size after:"+list.size()); } }

5 Answers   Rolta,


Why vector class is used?

0 Answers  


what is polymorphism?

4 Answers  


Categories