What is the difference between throw and throws?

Answer Posted / balaji

throw:it is used to raise exception explicitly
that means it is use when a user defined exception is raised

throws:if a method is capable of throwing an exception but
it does not handle the exception that must be specified by
using "throws" class

Is This Answer Correct ?    23 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is java ee a framework?

522


What is the new line character?

560


What is dot operator?

574


How big is a pointer?

555


What are the advantages of autoboxing?

539






List implementations of list interface?

565


Why is java not 100% pure oops?

622


What is charat java?

544


How do you check if two given string are anagrams?

555


What does singleton class mean?

539


What is a nonetype?

565


What are the properties of thread?

504


what is the role of xml in core java?? and how we can use it?? can somebody give a sample program with explanation and from where i can read more about xml?????

1805


What is return keyword in java?

568


what is the use of bean managed and container managed with example?

1502