What is the difference between throw and throws?
What is the similarity between try and throw?

Answer Posted / amar

throw is a statement level.throws is a method level.
In manual exception handling,we can also use the throws to
handle the excepions by the jvm,insted of handling there.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What advantage do java's layout managers provide over traditional windowing systems?

539


How do you read and print a string in java?

519


Is there a case when finally will not execute?

563


What are latest features introduced with java 8?

584


What is meant by call by reference?

503






What is the purpose of the file class in java programming?

522


What do you know about the garbage collector?

606


What is substring in java?

614


Which sorting is best in java?

526


Is java a compiler?

563


What is threaded programming and when is it used? : Java thread

530


Draw a UML class diagram for the code fragment given below: public class StringApplet extends Applet { private Label sampleString; private Button showTheString; private ButtonHandler bHandler; private FlowLayout layout; public StringApplet() { sampleString = new Label(" "); showTheString = new Button (" Show the String"); bHandler = new ButtonHandler(); layout = new FlowLayout(); showTheString.addActionListener(bHandler); setLayout(layout); add(sampleString); add(showTheString); } class ButtonHandler implements ActionListener { public void actionPerformed(ActionEvent e) { samplestring.setText("Good Morning"); } } } Note: The methods need not be indicated on the diagram.

1582


How is treeset implemented in java?

486


How many functional interfaces does java 8 have?

599


What is remote method invocation (rmi)?

608