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 is bytecode in java ?
If two threads have same priority which thread will be executed first ?
do I need to use synchronized on setvalue(int)? : Java thread
How to Sort Strings which are given in List and display in ascending order without using java api.
What are the five major types of reference sources?
Is ++ operator is thread safe in java?
What is n in java?
What is string manipulation?
Tell me about your ability to work under pressure
What is the purpose of methodology?
What is the original name of java?
Why is singleton class used?
What is method overloading and method overriding?
Define an enumeration?
How do you write a conditional statement?