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
What is a parameter in simple terms?
In Java list the methods that can be overridden?
How many threads can java run?
Can a private method be declared as static?
What is the list interface?
Compare Mutex and Semaphore in java.
What is the use of inner class?
what is aggregation in java?
What are "methods" and "fields"?
What are the classes of java?
How many bits is a string?
what are abstract functions?
Write the algorithm to check the number non-leaf nodes in a tree.
What is a boolean structure?
Can we clone singleton object?