What is the difference between throw and throws?
Answer Posted / kanhaiya sharma
throws :- throws clause is used when programmer does
not want to handle to the exception and throw it out of a
method.
throw :- throw clause is used when programmer wants to
throw an exception explicitely and wants to handle it using
catch block. hence throws and throw is contradictory.
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
What does method mean?
What is the tradeoff between using an unordered array versus an ordered array?
What is the major drawback of internal iteration over external iteration?
What do you mean by exception handling in Java?
How do you start a thread?
Explain the selection sort algorithm?
Which is the best approach for creating thread ?
Why are variables important in research?
What is sizeof in java?
What is the purpose of checked and unchecked exceptions in JAVA?
How do you declare a variable?
why not override thread to make a runnable? : Java thread
When do I need to use reflection feature in java?
How do you change an int to a string?
Why is logger singleton?