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
Differentiate storage classes on the basis of their scope?
Can we force the garbage collection to run?
What is io stream in java?
Why is singleton class used?
Can we clone singleton object?
What does next mean in java?
What are operators and its types?
who can i handle multiple client in RMI
Can private class be extended java?
Why is logger singleton?
What is the order of arraylist in java?
What are daemon Threads in java?
What is %d in printf?
Can you extend singleton class?
What is use of static in java?