What is the difference between throw and throws?

Answer Posted / kashi

thow is used to explicitly transfer the userdefined
exception class object from the function to the calling
place.
thows is used to mention or indicate to the compiler as
well as the enduser, that a particular function is proven
to generate exception class object and those objects are
not handled in the function itself.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is methodological framework?

773


Write a program to check for a prime number in java?

766


Why is the main method static?

848


What is difference between core java and java ee?

654


Which is bigger float or double?

741


What is thread count in java?

714


Is final static java?

752


What is difference between hashset and hashmap in java?

680


What does file separator do in java?

721


What do you understand by overloading and overriding in java?

748


What is the difference between equals() and == in java?

681


Is string a class in java?

711


What is the difference between error and an exception?

754


What is the string function?

732


what is the purpose of using rmisecuritymanager in rmi?

747