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

Does google use java?

526


How can we create a thread in java?

583


Is it possible to instantiate the abstract class?

534


what are the states associated in the thread? : Java thread

586


How many threads does a core java have?

507






Why does java does not support multiple inheritance? Explain

545


Can a class be declared as protected?

529


what state does a thread enter when it terminates its processing? : Java thread

592


What does t in java mean?

530


Do you know why doesn't the java library use a randomized version of quicksort?

546


What are the different types of inner classes?

528


If we don’t want some of the fields not to serialize how to do that?

560


What is tcp ip in java?

581


What are different types of states exist for a thread?

543


How java is similar to c?

582