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
Explain the difference between protected and default access.
what is interface in java? Explain
What do you mean by checked exceptions?
What is the difference between @before and @beforeclass annotation?
What is the difference between == and === javascript?
Can bool be null?
What are recursive functions? Give some examples?
Is special character in java?
What is linked hashset and its features?
What is meant by collection in java?
What means public static?
What is runtime locatable code?
Does java initialize arrays to zero?
What is the public method modifier?
Does treeset use compareto?