what is difference between throw and throws in exception?
Answer Posted / deewan singh
throw keyword is used to throw Exception from any method or static block in Java while throws keyword, used in method declaration, denoted which Exception can possible be thrown by this method.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are the practical benefits, if any, of importing a specific class rather than an entire package (e.g. Import java.net.* Versus import java.net.socket)?
How are variables stored in memory?
What is a boolean flag in java?
What are the advantages of exception handling in java?
What is bufferedreader in java?
What is the difference between stream and buffer?
take an array with -ve and +ve value both.find out the nearest value of 0(zero).if two values are same like(-2 and +2)then extract +2 is nearest of 0(zero).
Explain different types of wrapper classes in java?
Difference between static synchronization vs. Instance synchronization?
Explain the difference between jvm and jre?
What are the different types of sorting in java?
What is use of functional interface in java 8? Explain
Why we use methods in java?
Describe what a thread-local variable is in java?
What are internal variables?