what is difference between throw and throws in exception?
Answer Posted / manu
throw: It is used to explicitly or manually throw an
exception.it can throw user defined exceptions.
throws:It tells that exception to b handled by calling
function. It tells caller that what exception that method
could throw.
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
Write a java program to count the number of words present in a string?
What is purpose of keyword void?
What is the advantage of functional interface in java 8?
Can you sort a string in java?
What is the difference between the final method and abstract method?
What is the importance of main method in Java?
What is difference between static class and normal class?
What does java ide mean?
How to disable caching on back button of the browser?
What is tcp and udp?
What is the file type?
Explain the difference between comparator and comparable in java?
What are local variables?
What happens if we override private method?
Is passing by reference faster?