What is the difference between throw and throws?
Answer Posted / suresh
mainly throw is used for user defined exceptions and throws
is used for compiler defined excetions.
Ex: if u get a NullPointer exception then we throws this
excetion to the compiler defined excetion class.
if u get malformed or ur own excetion in this time we to
throw this to our own defined excetion
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
How to sort an array from smallest to largest java?
Which programming language is most secure?
Explain public static void main(string args[]) in java.
What is the difference between the font and fontmetrics classes in java programming?
what is the constructor and how many types of constructors are used in java?
Why are parameters used in functions?
Which variables are stored in heap?
Are registers volatile?
What are internal and external variables?
What is the purpose of final keyword and when to use it?
What is entry in java?
What is a hashmap used for?
Write a java program to count the number of words present in a string?
What is the requirement of thread in java?
How do you clear a method in java?