what is difference between throw and throws in exception?
Answer Posted / sinduja
THROW IS USED TO THROW AN EXCEPTION EXPLICITLY WHEREAS,THROWS INCLUDED IN THE METHODS DECLARATION PART WITH A LIST OF EXCEPTION THAT IT CAN POSSIBLE TO THROW.
THROW IS USED TO PASS CUSTOMER MESSAGE.AND THROW HANDLES
USER DEFINE EXCEPTION.
WHEREAS THROWS IS HANDLED BY JVM.
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
Why are getters and setters used?
What is string and example?
What is struts in java?
Can I learn java without any programming experience?
Which is the class in java?
Can a constructor call the constructor of parent class?
What is the purpose of the enableevents() method?
Write a java program to count the number of words present in a string?
How many times finalize method will be invoked? Who invokes finalize() method in java?
Does garbage collection occur in permanent generation space in jvm?
What will happen if a thrown exception is not handled?
What is the use of object and class classes?
Can we inherit a class with private constructor?
What are the restriction imposed on a static method or a static block of code?
What is double parsedouble in java?