what is difference between throw and throws in exception?

Answer Posted / ravikumar

Throws - what ever the exception you are declaring are
taken care by JVM. If it is a user defined exception in throws
block, JVM doesn't know when to throw that exception . For
this purpose we use Throw for a certain conditions/logic to
throw these user defined exceptions

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does the garbage collector works in java?

574


Can we overload final method in java?

557


What is arrays sort in java?

578


What are the 3 types of control structures?

531


What does opcode mean?

543






Can we use string in the switch case?

579


What do the thread?class methods run() and start() do?

547


Why is multithreading important?

498


How garbage collection is done in java?

551


What is character in data type?

553


Define iterator and methods in iterator?

547


Do you know why doesn't the java library use a randomized version of quicksort?

556


Difference between static binding and dynamic binding?

571


Can array grow dynamically in java?

528


How is it possible for two string objects with identical values not to be equal under the == operator?

530