what is difference between throw and throws in exception?

Answer Posted / lokesh

throws is used for throwing an exception from a method to
jvm, the jvm should handle it.where us throw is used when
user needs to raise his own exception.

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between iterator and list iterator?

536


What are scalar data types?

528


What is the meaning of I ++ in java?

609


What is the use of a copy constructor?

575


Say any two properties in beans?

636






What is the protected method modifier?

564


Explain the purpose of garbage collection in Java?

578


How do you take thread dump in java?

562


Explain the hierarchy of java exception classes?

601


How many bits are in a sentence?

589


What is the difference between a method and a procedure?

552


Is finalize() similar to a destructor?

555


Can a class be protected in java?

506


How we can run a jar file through command prompt in java?

525


Can a variable be local and static at the same time?

548