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 hashset is used in java?
What is the purpose of the runtime class in java programming?
What is the file extension for java?
How do weakhashmap works?
Can you give few examples of final classes defined in java api?
How variables are declared?
Why is multiple inheritance not supported in java?
Give me an example of array and linked list? Where they can be used?
How do you end a program?
what is interface in java? Explain
what is a thread pool in java and why is it used?
Why vector is used in java?
How can you set the applet size?
Write a program to solve producer consumer problem in java?
What does math floor () do?