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 arguments in java?

524


How do you reverse sort in java?

506


What is enhanced loop in java?

551


what are the disadvantages of indexes in oracle?

1867


What are the different types of sorting in java?

540






When will we prefer to use set and list in java and why?

550


What is the purpose of default constructor?

583


what is the difference between process and thread? : Java thread

565


What is ide with example?

548


What is array and arraylist in java?

533


How many bits is a float?

545


Explain about main thread in java?

615


How can you read content from file in java?

599


Are arrays passed by reference in java?

492


What is memory leak and how does java handle it?

525