what is difference between throw and throws in exception?
Answer Posted / chandrakala
throw and throws are clauses.
throws: if we are not interested to catch the exception then we have to use throws. if any exception arises then internally JVM handles that exception.
throw: If we want to throw an exception explicitly we have to use throw.It comes under user defined exception.
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are the different data types in java?
What is method and methodology?
What are the differences between string, stringbuffer and stringbuilder?
What is mnemonic in assembly language?
What is float in java?
What is the purpose of checked and unchecked exceptions in JAVA?
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.
Explain the difference between an Interface and an Abstract class?
What is the escape character in java?
What is the unit of plancks constant?
Difference between arraylist and vector.
What is rmi and steps involved in developing an rmi object?
What is methods and methodology?
what is deadlock? : Java thread
Is java 1.7 the same as java 7?