What is the difference between throw and throws?
Answer Posted / kanhaiya sharma
throws :- throws clause is used when programmer does
not want to handle to the exception and throw it out of a
method.
throw :- throw clause is used when programmer wants to
throw an exception explicitely and wants to handle it using
catch block. hence throws and throw is contradictory.
Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
Explain the features of interfaces in java?
Which method you will use to create a new file to store some log data. Each time a new log entry is necessary, write string to the file in java ?
What is the default size of arraylist in java?
Is array dynamic in java?
What is the file extension for java?
What are bind parameters?
How do I write a self declaration?
What is an exception? difference between Checked and Unchecked exception in Java
Why set do not allow duplicates in java?
Can we have a try block without catch block?
How many types of string data types are there?
What are the differences between string and stringbuffer?
Is java same as core java?
Can you run java program without main method?
Explain java code for recursive solution's base case?