what is difference between throw and throws in exception?

Answer Posted / pavithra

throws is used to throw an exception from the method
without handling that exception where as 'throw' is used
to throw the exception to catch block and handle it.

Is This Answer Correct ?    123 Yes 79 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

os is developed in c no java is more secured then c na why dont the os developed is developed using java

3528


What is the formula to calculate percentage?

540


What is t in parametric equations?

552


What is the purpose of javac exe?

563


Explain about object oriented programming and its features?

602






What happens when you invoke a thread’s interrupt method while it is sleeping or waiting?

580


What is the constructor?

585


What is instance example?

527


What are data types in oop?

557


What is the difference between the size and capacity of a vector?

571


Explain about core java?

631


Is null function in java?

570


How do you stop a thread in java?

600


What is the difference between multitasking and multithreading in Java

728


Can finally block be used without a catch?

548