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
When will you define a method as static?
What is a parameter example?
What variables are stored in stack?
How will you get the platform dependent values like line separator, path separator, etc., ?
If goto and const is reserve words than why it is not work in java?
Can we create a constructor in abstract class?
Discuss 2D arrays.
What environment variables are required to be set on a machine in order to run Java programs?
What is the difference between method and means?
Why local variables are stored in stack?
What is the main use of generics in java?
What is concurrent hashmap and its features?
What is difference in between java class and bean?
Which types of exceptions are caught at compile time?
What is the best way to findout the time/memory consuming process?