JOIN ADRE 2.0 Telegram Group

Exception Handling in Java - Questions and Answers for Java Examinations

Questions
6 When the JVM runs out of memory, which exception will be thrown?
A MemoryBoundException
B OutOfMemoryError
C OutOfRangeException
D NullReferenceException

Answer: Option [B]

When a program is stopped due to lack of memory then OutOfMemoryError is thrown.

7 In Java programming environment, the throw keyword is used
A to generate exception programmatically
B to throw exception object
C to catch exception object
D none of the above

Answer: Option [A]

In Java throw keyword is used to handle exception programmatically.

Advertisement
ADRE 2.0 Mock Test - 5 Start Test
ADRE 2.0 Mock Test - 5 Start Test

DOWNLOAD CURRENT AFFAIRS PDF FROM APP

8 Which exception is thrown by read() method ?
A Exception
B FileNotFoundException
C ReadException
D IOException

Answer: Option [D]

IOException is thrown when I/O operation is failed.

9 Attempting to access a character that is outside the bounds of a StringBuffer results in a
A ArrayIndexOutOfBoundsException
B StringOverFlowException
C StringException
D StringIndexOutOfBoundsException

Answer: Option [D]
10 Exception and Error are immediate subclasses of a class called
A Object
B Throwable
C AWT
D Panel

Answer: Option [B]

Throwable is a superclass of all Error and Exception classes.

ADRE 2.0 MOCK TEST

Take Mock Tests

Government Schemes Mock Test Start Test!
Political Science Mock Test – 42 Start Test
History Test – 190 Start Test
Quantitative Aptitude Test Start Test!
Trigonometry - Mock Test Start Test!
Data Interpretation - Mock Test Start Test!
General Awareness - Mock Test Start Test!
Reasoning Ability - Mock Test Start Test!
Englist(Antonyms) Mock Test 1 Start Test!
Quantitative Aptitude (Percentage) Mock Test Start Test!
Economy Mock Test 1 Unlock Test!
Books & Authors - Test 2 Unlock Test!

Chapters

Advertisement