KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
In Java, what is the difference between the twin methods? public void methodA() throws AnException { //do something throw new AnException(); } public void methodA() { //do the same thing throw new AnException(); } I have a intuition that it has something to do with being a well-designed method (because I put methodA in an interface, declared it the way methodA* does in its implementation and received a warning from Java that "A* cannot override A because A* doesn't throw AnException"). Is this speculation correct? Is there any other subtle connotations in the two ways of doing things?
Tags (comma-separated)
Save Edits
Cancel