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 to change the priority of thread or how to set the priority of thread?
Explain super keyword in java.
Can I override protected method in java?
Explain method overloading?
What is nested class?
Which data type is class in java?
What is the full name of java?
If a method is declared as protected, where may the method be accessed?
What are the three parts of a lambda expression? What is the type of lambda expression?
Can we override constructor?
What are the 5 types of research methods?
What is multi level inheritance in java?
Can bool be null?
What is adapter in java?
How does thread synchronization occurs inside a monitor? What levels of synchronization can you apply?