what difference between throw and throws in exception
handling.

Answer Posted / dani

You can declare multiple exception thrown by method in
throws keyword by separating them in common
e.g. throws IOException, ArrayIndexBoundException etc,

while you can only throw one instance of exception using
throw keyword e.g. throw new IOException("not able to open
connection").

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the 3 types of control structures?

734


What is a numeric format?

792


Describe string intern() methodology

818


Explain the JDB in depth & command line.

801


What is difference in between java class and bean?

809


What is 32 bit float?

773


What is a double vs float?

758


Can we instantiate interface in java?

911


What are keyboard events?

857


What is scope & storage allocation of global and extern variables? Explain with an example

807


What is finalize() function in java?

764


What is the use of a conditional inclusion statement in Java ?

828


what is thread? What are the high-level thread states? Or what are the states associated in the thread? : Java thread

774


What is the use of list in java?

752


What is the ==?

685