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
Why is a constant variable important?
How do you compare values in java?
What is ph and buffers?
Can we convert list to set in java?
Explain importance of throws keyword in java?
Can we create an object if a class doesn't have any constructor ( not even the default provided by constructor ) ?
What is io stream in java?
What is the latest version of java?
Does java support Operator Overloading?
Explain different types of wrapper classes in java?
What is the exact difference in between Unicast and Multicast object?
Can a constructor be made final?
What are the main uses of java?
Why generics are used in java?
Which is faster string or stringbuilder?