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 is callable java?
Difference between character constant and string constant in java ?
Explain java coding standards for variables ?
What is a constructor overloading in java?
Define class?
Explain the advantages of packages in java?
What is the string function?
What is the tradeoff between using an unordered array versus an ordered array?
Can we have try block without catch block?
Can a abstract class be declared final?
What is the purpose of the strictfp keyword?
Can you declare the main method as final?
State the difference between creating string as new () and literal.
Say any two properties in beans?
Is oracle java 11 free?