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
How do you do exponents in java?
Does anyone still use java?
What does math floor () do?
How many types of java are there?
Can we convert integer to string in java?
When should I use a singleton?
What is defined as false sharing in the context of multithreading?
Give a practical example of singleton class usage?
How does java pattern compile work?
Explain numeric promotion?
How does queue work in java?
What is the difference between keyword and identifier?
Is java type safe?
When do you call copy constructor?
Which java collection does not allow null?