what is difference between throw and throws in exception?
Answer Posted / pavithra
throws is used to throw an exception from the method
without handling that exception where as 'throw' is used
to throw the exception to catch block and handle it.
| Is This Answer Correct ? | 123 Yes | 79 No |
Post New Answer View All Answers
Does printwriter create a file?
How would overload a function based on return type?
Can we convert stringbuilder to string in java?
Is java good for beginners?
Explain how to force the garbage collection in java.
What does sprintf mean?
What does string intern() method do?
What is hashmap and map?
What is binary search in java?
What is the difference between jvm and jre? What is an interface?
What is bytecode in java ?
Can we declare the main method of our class as private?
How many bits is a 64 bit byte?
Can an interface be defined inside a class?
What are the different types of constructor?