What is the difference between throw and throws?
Answer Posted / kanhaiya sharma
throws :- throws clause is used when programmer does
not want to handle to the exception and throw it out of a
method.
throw :- throw clause is used when programmer wants to
throw an exception explicitely and wants to handle it using
catch block. hence throws and throw is contradictory.
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
What is a class reference?
what is the major difference between linkedlist and arraylist in java?
Where will it be used?
Explain about exception propagation?
List some important characteristics on jre
What's the base class in java from which all classes are derived?
What is mnemonic code?
Is node a data type in java?
Is main a keyword in java?
5 Coding best practices you learned in java?
What modifiers may be used with an inner class that is a member of an outer class in java programming?
Can singleton class be serialized?
How do you calculate roots in java?
What is the difference between a factory and abstract factory pattern?
Q1.A. Write note on “The class path Environment Variable”? B. Which are different kinds of source code? Q2.A. How to create an interface? B. Why convert an applet to an application? Q3.A. How to use Media tracker Class. B. How to use string tokenizer class. Q4 A. Explain the overview of UDP messaging. B. Difference between SQL Exception class and SQL Warning class. Q5. A. How to create com object in Java? B. Write short notes on “The properties class” Q6. A. When object is created and destroyed? B. Explain the JDB in depth & command line. C. Write short notes on Web Sites.