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
What is balanced tree in java?
What is thread pool? How can we create thread pool in java?
When can we say that threads are not lightweight process in java?
What do negative exponents mean?
List primitive java types?
What is the difference between compile-time polymorphism and runtime polymorphism?
Print Vertical traversal of a Binary Tree.
Write a regular expression to validate a password. A password must start with an alphabet and followed by alphanumeric characters; its length must be in between 8 to 20.
What is the main difference between java platform and other platforms?
How are this() and super() used with constructors in java programming?
Does google use java?
What value is a variable of the string type automatically initialized?
Can I uninstall java?
What are parsers? Dom vs sax parser.
What is a generic code?