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
Explain different forms of polymorphism?
What classes of exceptions may be caught by a catch clause in java programming?
Explain about map interface in java?
What about method local inner classes or local inner classes in java?
What is xslt in java?
What is void keyword?
Is map ordered in java?
What is the difference between class & object?
What is main method?
How many bytes is a string?
What is a parameter in simple terms?
Do I need java on my pc?
Difference between ‘is-a’ and ‘has-a’ relationship in java?
Is arraylist an object in java?
What is the list interface in java programming?