What is the difference between throw and throws?
Answer Posted / kashi
thow is used to explicitly transfer the userdefined
exception class object from the function to the calling
place.
thows is used to mention or indicate to the compiler as
well as the enduser, that a particular function is proven
to generate exception class object and those objects are
not handled in the function itself.
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What is a parameter in simple terms?
Can sleep() method causes another thread to sleep?
Can we declare an interface as final?
What is java virtual machine? Explain
design an lru cache in java?
What is difference between next () and nextline () in java?
Can a class have more than one object?
What is the difference between quicksort & mergesort? When should they be used? What is their running time?
What are 3 boolean operators?
What does this () mean in constructor chaining concept?
Difference between predicate, supplier and consumer ?
Explain the use of shift operator in java. Can you give some examples?
What is a treeset class?
What is the difference between throw and throws in java?
What is array size in java?