What is the difference between throw and throws?
Answer Posted / senthil nathan
throws: If a method is not capable of handling the raised
exception and it wants the caller of the method to
handle the exception means then the method uses the
"throws" keyword... The exception raised here is
of System Exception not User Exception...
throw: If the method is capable of handling the exception
by using try&catch block then this method uses the
"throw" keyword.. It is also used to raise our own
exception.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Why we cannot override static method?
What two classes are used to read data only?
Which is a valid identifier?
What is console based application in java?
Difference between string, string builder, and string buffer?
What is a ternary operator in java?
What are kinds of processors?
How do you reverse a list?
Is singleton class immutable?
Explain about complier design(phases)
What is the disadvantage of synchronization?
Is null == null in java?
What is difference between class and object in java?
Which method returns the length of a string?
Does unicode support all languages?