Catch(Exception e){
}
in that what is Exception and purpose of that in that place
exactly?
Answers were Sorted based on User's Feedback
Answer / anjani kumar jha
Before understand the concept of Catch u have to understand
the concept of try,that is why try?
Try-------it is used when we know that some piece of code is
going to throw some exception example when u are dividing
somthing/0 means it may throw exception so we use the try
block and put that code inside the try block
Catch:--------Every try there must be catch or finally
block. Catch is used to catch to exception.As for example
the division example may throw airthmatic exception so will
declare this exception in catch like
Catch(AirthmaticException ae)
{
System.out.println("hi cannt divide by zero");
System.out.println(ae);
}
Is This Answer Correct ? | 5 Yes | 0 No |
Answer / sreenu karampudi
The Catch block is used to catch the exception which is
from the try block. The exception type should be same in
order to catch it otherwise it won't
for example;
try {
// piece of code which gets ArthimeticException
}
Catch(ArthimeticException e) [
}
Is This Answer Correct ? | 2 Yes | 1 No |
Answer / kabita
bcoz Exception is d base class of all exceptions arise in d
programme.if u write this no need to consider what type of
exception is arised in try block of d programme.,it will
handle all d exception.
Is This Answer Correct ? | 0 Yes | 2 No |
What are multiple inheritances?
Given: 11. public static void main(String[] args) { 12. Integer i = uew Integer(1) + new Integer(2); 13. switch(i) { 14. case 3: System.out.println(”three”); break; 15. default: System.out.println(”other”); break; 16. } 17. } ‘What is the result? 1 three 2 other 3 An exception is thrown at runtime. 4 Compilation fails because of an error on line 12.
What is the meaning of variable in research?
why Java does not support multiple inheritances?
What is thread start?
What do you mean by platform independence? What is an interface?
How do you create a sop?
What is meant by controls and types?
What does math floor () do?
Does google use java?
What is java autoboxing?
What is passing parameters in java?