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
how we can make a write-only class in java?
What do you mean by ternary operator in java?
How we create object in copy constructor?
What is fail fast in java?
What is the purpose of garbage collection in java?
What is the use of flag?
Is a copy constructor?
When is the garbage collection used in Java?
What are format specifiers in java?
How do we access static members in java?
How to sort an unsorted array in java?
Explain the reason behind ending a program with a system.exit(0)?
What is files manifesting?
Why java is object oriented?
What are the advantages of autoboxing?