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
Which types of exceptions are caught at compile time?
What is use of set in java?
How the metacharacters are different from the ordinary characters?
Why local variables are stored in stack?
Tell me are there implementations for sorting and searching in the java libarary?
What is a treemap in java?
What are daemon Threads in java?
Why do we override tostring method in java?
What is the difference between method and means?
Break statement can be used as labels in java?
What is gc()?
Does java support multiple inheritances?
Which methods cannot be overridden in java?
How dead lock situation occurs in java and how you can identify it?
What is a control variable example?