Catch(Exception e){
}
in that what is Exception and purpose of that in that place
exactly?
Answer Posted / 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 |
Post New Answer View All Answers
What is the similarity between dynamic binding and linking?
What is executor memory?
What is the full name of java?
Explain about automatic type conversion in java?
What is meant by anonymous class?
What is join () in java?
Which is better list or arraylist in java?
What is math in java?
Write a program to search a number in the given list of numbers.
What is a prefix function.write down a code to compute prefix function.
What is a flag variable?
What is the driver class?
What is arrays aslist in java?
Hi Anyone know the model / questions of the Federal bank sample questions for the post of Specialist Officers - Programmers. Please post if anyone have..
Explain differences between collection api and stream api?