top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

How to make sure that Subclass method actually overrides the method of the superclass or parent class in Java?

+3 votes
182 views
How to make sure that Subclass method actually overrides the method of the superclass or parent class in Java?
posted Sep 22, 2013 by Manish Negi

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+1 vote

Due the presence of @Override annotation in the javadoc ,if you accidently miss an argument or capitalize the method name wrong, the compiler 'll generate a compile-time error.

answer Sep 23, 2013 by Arvind Singh
+1 vote

This is the perfect scenario to Use Abstract class .Make the method to be overriden abstract in parent class and mark the class as Abstract.

answer Oct 1, 2013 by Vikalp Kumar
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...