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


Please Help Members By Posting Answers For Below Questions

What is the difference between the font and fontmetrics classes in java programming?

711


How to sort elements in a parallel array in java?

689


Why is flag used in java?

759


Is ++ operator is thread safe in java?

703


Where import statement is used in a java program?

823


What is the size of boolean variable?

832


can java object be locked down for exclusive use by a given thread? Or what happens when a thread cannot acquire a lock on an object? : Java thread

752


How do you sort a set in java?

725


Can a class have more than one object?

757


What are the important features of Java 8 release?

814


What is the purpose of garbage collection in java? When is it used?

811


Why singleton pattern is better than creating singleton class with static instance?

798


What is a java developer salary?

741


Name few java.lang classes introduced with java 8 ?

755


What is parsing and its types?

784