what difference between throw and throws in exception
handling.
Answer Posted / dani
You can declare multiple exception thrown by method in
throws keyword by separating them in common
e.g. throws IOException, ArrayIndexBoundException etc,
while you can only throw one instance of exception using
throw keyword e.g. throw new IOException("not able to open
connection").
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How do you know if a value is nan?
What is the difference between inner class and nested class?
Explain the difference between private, public, package and protected in java?
What access modifiers can be used for methods?
What is method overloading and method overriding?
Explain a few methods of overloading best practices in java?
What is lexicographically smallest string?
Why do we need data serialization?
What are unchecked exceptions in java?
How do I stop concurrentmodificationexception?
1.IN CASE OF DYNAMIC METHOD DISPATCH WHY WE USE REFERENCE VARIABLE,WE CAN USE THE DIFFERENT DEFINED OBJECT DIRECTLY TO ACCESS THE DATA MEMBER AND MEMBER FUNCTION OF THAT RESPECTIVE CLASS?WHAT IS THE MAIN FUNCTION OF "REFERENCE VARIABLE" HERE?
What are the four versions of java?
What is memory leak and how does java handle it?
What does @override mean?
What happens if a constructor is declared private?