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 does java not allow multiple public classes in a java file ?
Explain about the security aspect of java?
What is file in java?
how to create multithreaded program? Explain different ways of using thread? When a thread is created and started, what is its initial state? Or extending thread class or implementing runnable interface. Which is better? : Java thread
What is the collections api?
Where is the find and replace?
Which category the java thread do fall in?
What is the final class modifier?
How many bits is a 64 bit byte?
What is the difference between multiple processes and multiple threads?
Is boolean a wrapper class in java?
What is an accessor?
How many ways can you break a singleton class in java?
How to split arraylist elements in java?
Is java owned by oracle?