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

Why do we create public static method in java?

675


What is the collections api?

662


Are floats faster than doubles?

662


What is isa relationship?

645


What is the difference between length and length () in java?

614






Can we catch more than one exception in single catch block?

713


What are parsers? Dom vs sax parser.

650


what is deadlock? : Java thread

615


Suppose if we have variable ' I ' in run method, if I can create one or more thread each thread will occupy a separate copy or same variable will be shared?

634


Is age discrete or continuous?

781


Explain spliterator in java8?

692


What is the use of predicate in java 8?

571


What is the default value of the local variables?

600


What does the “static” keyword mean?

677


Explain about static imports in java?

685