Java Programming Solved MCQs (Set-4)
Java Programming Solved MCQs (Set-4)
79. Which of the following exception is raised when a number is divided by zero
A. NumberFormatException
B. ArithmeticException
C. NullPointerException
D. IllegalArgumentException
Answer: B
81. Which of these exceptions will occur if we try to access the index of an array
beyond its length?
A. ArithmeticException
B. ArrayException
C. ArrayIndexException
D. ArrayIndexOutOfBoundsException
Answer: D
82. Runnable is a
A. Class
B. Method
C. Variable
D. Interface
Answer: D
87. Which of this method of Thread class is used to change the state of a thread to
blocked state?
A. sleep()
B. terminate()
C. stop()
D. block()
Answer: A
88. Which method in Thread class is used to check weather a thread is still
running?
A. isAlive()
B. Join()
C. isRunning()
D. Alive()
Answer: A
92. Which of these classes is used to read characters and strings in Java from
console?
A. BufferedReader
B. StringReader
C. BufferedStreamReader
D. InputStreamReader
Answer: D
93. Which of these classes are used by Byte streams for input operation?
A. InputStream
B. InputOutputStream
C. Reader
D. All of the mentioned
Answer: A
94. Which of these class contains the methods print() & println()?
A. System
B. System.out
C. BufferedOutputStream
D. PrintStream
Answer: D
96. Which of these classes are used by character streams output operations?
97. Which refers to a channel through which data flow from the source to the
destination:
A. String
B. Character
C. Stream
D. Buffer
Answer: C