Java Programming Solved MCQs (Set-4)

Download as xlsx, pdf, or txt
Download as xlsx, pdf, or txt
You are on page 1of 5

76. Which exception is thrown by read() method?A. IOExceptionB. InterruptedExceptionC. SystemExceptionD.

SystemInputException An

77. Which is the super class of all exception classesA. ExceptionB. ObjectC. ErrorD. Throwable Answer: D

78. Which class is the super class of all classes of the java.lang package?A. ObjectB. SystemC. SuperD. Class Answer: A

79. Which of the following exception is raised when a number is divided by zeroA. NumberFormatExceptionB. ArithmeticExceptionC. Nu

80. A single try block must be followed by which of these?


A. finally
B. catch
C. catch or finally

Java Programming MCQs [set-4]

D. None of the mentionedAnswer: C


81. Which of these exceptions will occur if we try to access the index of an array beyond its length?A. ArithmeticExceptionB. ArrayExcep

82. Runnable is aA. ClassB. MethodC. VariableD. Interface Answer: D

83. Thread priority in Java is represented as?A. intB. FloatC. doubleD. long Answer: A

84. Which of these class is used to make a thread?A. StringB. SystemC. ThreadD. Runnable Answer: C

85. Which of these interface is implemented to create a Thread?A. RunnableB. ConnectionsC. SetD. MapConnections Answer: A
86. Which of these method of Thread class is used to find out the priority given to a thread?A. get()B. ThreadPriority()C. getPriority()D. ge

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(

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:

89. Which of these methods is used to begin the execution of a thread?A. run()B. start()C. runThread()D. startThread() Answer: B

90. Which of these method waits for the thread to treminate?A. sleep()B. isAlive()C. join()D. stop() Answer: C
91. Which of these is used to read a string from the input stream?A. get()B. getLine()C. read()D. readLine() Answer: D

92. Which of these classes is used to read characters and strings in Java from console?A. BufferedReaderB. StringReaderC. BufferedStream

93. Which of these classes are used by Byte streams for input operation?A. InputStreamB. InputOutputStreamC. ReaderD. All of the menti

94. Which of these class contains the methods print() & println()?A. SystemB. System.outC. BufferedOutputStreamD. PrintStream Answe

95. Which of these methods can be used to write console output?A. printout()B. println()C. write()D. All of the mentioned Answer: B

96. Which of these classes are used by character streams output operations?
A. OutputStreamB. WriterC. ReadStreamD. InputOutputStream Answer: B

97. Which refers to a channel through which data flow from the source to the destination:A. StringB. CharacterC. StreamD. Buffer Answer

98. Java Stream classes can be categorized into two groups:A. Byte and Character Stream ClassesB. Stream and String ClassesC. String an

99. Byte Stream Classes support input/output operations on            A. 8 bitB. 16 bitC. 32 bitD. 64 bit Answer: A

100. Character Stream Classes support input/output operations on                 characters:A. 8 bit UnicodeB. 16 bit UnicodeC. 32 bit Unicode

You might also like