what is difference between throw and throws in exception?
Answer Posted / sathiya moorthy v
throw --> manually throw exception.
Ex: throw ThrowableInstance;
throws -->Any exception that is thrown out of a method must
be specified as such by a throws clause
Ex: <access specifier> <return type> <methodName> throws
Exception{
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What are the new features in java 8? Explain
Can we use string in switch case in java?
What does s mean in regex?
Which graphs are functions?
Is java written in c?
What are java threads?
Define the term string pool?
How do you download stubs from Remote place?
What is Hierarchy of exception?
Can constructor be inherited?
How to print nodes of a Binary tree?
What is constructor chaining in java?
How do you sort arrays in java?
Is java 11 paid version?
Which method must be implemented by all threads?