how can u handle run time exception in java? explain with
brief explanation with examples?
Answer Posted / pavithra
Runtime exceptions represent problems that are detected by
the runtime system. This includes arithmetic exceptions
(such as when dividing by zero), pointer exceptions (such
as trying to access an object through a null reference),
and indexing exceptions (such as attempting to access an
array element through an index that is too large or too
small).
Runtime exceptions can occur anywhere in a program and in a
typical program can be very numerous. Typically, the cost
of checking for runtime exceptions exceeds the benefit of
catching or specifying them. Thus the compiler does not
require that you catch or specify runtime exceptions,
although you can.
| Is This Answer Correct ? | 5 Yes | 8 No |
Post New Answer View All Answers
What is the technique adopted to create an immutable class?
Can we sort hashmap in java?
Will the compiler creates a default constructor if I have a parameterized constructor in the class?
If we allocate the memory using 'new' & de-allocated using 'free' then what will happen?
What does mean in regex?
How many types of memory areas are allocated by jvm?
What about method local inner classes or local inner classes in java?
Define the term string pool?
Name few "optional" classes introduced with java 8 ?
Which is better list or arraylist in java?
How do you add an element to a set in java?
Explain which of the following methods releases the lock when yield(), join(),sleep(),wait(),notify(), notifyall() methods are executed?
How do you write a good declaration?
Why hashcode is used in java?
How does multithreading take place on a computer with a single cpu in java programming?