How do you override a method?



How do you override a method?..

Answer / Shah Faisal Khan

To override a method in Java, you need to create a subclass and provide an implementation for the method you want to override. The overridden method should have the same return type, method name, and parameter list as the original method in the superclass.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

Can we add two byte variables and assign the result to a byte variable ? b=b1+b2 where b,b1,b2 are byte types

4 Answers   TCS,


please send code example of inner classes?

2 Answers  


What is variable argument in java?

1 Answers  


What does ide stand for?

1 Answers  


What function extracts specified characters from a string?

1 Answers  


what is diffrence between .NET and java?

2 Answers  


Is object a data type?

1 Answers  


What is the length of a string?

1 Answers  


Differentiate between a class and an object.

1 Answers  


Are arrays passed by reference in java?

1 Answers  


What is the default access specifier for variables and methods of a class?

1 Answers  


Is math an abstract class in java?

1 Answers  


Categories