Search Interview Questions | More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know. |
|
| ||||
Core Java - Interview Questions and Answers for 'Exceptions handling' - 2 question(s) found - Order By Newest | ||||
| ||||
Ans. Sometimes the calls move across layers of classes and functions and hence each layer needs to perform some function like cleaning if something goes wrong deep inside. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  exceptions  exceptions handling  rethrowing exception | ||||
Related Questions | ||||
| ||||
Ans. If we do not mention, Cloneable Interface to the Class which we want to Clone then we get this exception, only if we try to clone an object Like: public class TestClone{ @Override protected Object clone() throws CloneNotSupportedException { return super.clone(); } } In Main, You try to do: TestClone clone = new TestClone(); TestClone clone2 = (TestClone) clone.clone(); You will get CloneNotSupportedException. Just add -> public class TestClone implements Cloneable { and things are fixed. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  exceptions handling  cloning | ||||
Related Questions | ||||
What is the purpose of re throwing the exception when we can provide the handling at the first catch itself ? | ||||