Ask your own question, for FREE!
Computer Science 9 Online
OpenStudy (anonymous):

If a method throws NullPointerException in super class, can we override it with a method which throws RuntimeException?

OpenStudy (e.mccormick):

Are you saying you want to catch the one exception and generate a different one?

OpenStudy (lyrae):

That should be possible as NullPointerException implements RuntimeException. Example: http://ideone.com/94r0Xd Javdoc: http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!