Home Tutorial Java Certification Overriding in java

 
 

Overriding in java
Posted on: July 1, 2010 at 12:00 AM
Click on following link to know all about Overriding in Java

Some key points about overriding in java

  1. The overriding method must have same arguments, it means return type of argument should be same with number of argument.
  2. The overriding method must have less restrictive access modifier.
  3. The return type of overriding method must be the same.
  4. If you want your method not to be overridden mark it with final at the beginning.
  5. With context of constructor it can be overloaded but cannot be overridden.
  6. The concrete class overrides the abstract method.
  7. The private method is not overridden.
  8. A default method may be overridden by a default, protected or public method.
  9. A public overridden method then the overriding method must also be in public. But in the case of protected it can be overridden by protected and public also.
  10. A protected method may not be overridden by a default or private method.

More about Overriding

Related Tags for Overriding in java:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.