what is difference between throw and throws in exception?

Answer Posted / chandra sekhar

In Throws, what ever the exception you are declaring are
handle 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.

I think the above makes sense.

Is This Answer Correct ?    45 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many bytes is string in java?

880


What does void * mean?

715


Difference between comparator and comparable in java?

850


What are the advantages of java over C++?

924


What is the best definition for data?

714


What does escaping a character mean?

723


What is the difference between a break statement and a continue statement?

802


Explain the difference between jvm and jre?

779


How can you add and remove nodes in jtree?

803


What are the advantages and disadvantages of object cloning?

780


What is the public field modifier?

759


Is it possible to compare various strings with the help of == operator? What are the risks involved?

837


How is tree Mirroring implemented?

814


What is meant by main method?

785


Why java strings are immutable in nature?

774