what is difference between throw and throws in exception?
Answer Posted / chandra sekhar
In Throws, what ever the exception you are declaring are
handle by JVM. If it is a user defined exception in throws
block, JVM doesn't know when to throw that exception. For
this purpose we use Throw for a certain conditions/logic to
throw these user defined exceptions.
I think the above makes sense.
| Is This Answer Correct ? | 45 Yes | 5 No |
Post New Answer View All Answers
Can a constructor call the constructor of parent class?
How to implement a multithreaded applet?
Why call by value prevents parameter value change?
Which access specifier can be used with class ?
Why java applets are more useful for intranets as compared to internet?
Can we override private method?
What are the types of methods in java?
What is the full form of jpeg?
How do you reverse a word in java?
What is java used for?
What is the purpose of the return statement?
Is set ordered in java?
From the two, which would be easier to write: synchronization code for ten threads or two threads?
Can we use a default constructor of a class even if an explicit constructor is defined?
Is java hard to learn?