0% found this document useful (0 votes)
15 views

Java-Programming Solved MCQs (Set-4)

This document contains 100 multiple choice questions about Java programming topics like exceptions, classes, threads, streams and I/O. The questions cover concepts like exception handling, object oriented programming, multithreading and input/output stream classes in Java.

Uploaded by

e1513152528
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Java-Programming Solved MCQs (Set-4)

This document contains 100 multiple choice questions about Java programming topics like exceptions, classes, threads, streams and I/O. The questions cover concepts like exception handling, object oriented programming, multithreading and input/output stream classes in Java.

Uploaded by

e1513152528
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Java Programming MCQs [set-4]

76. Which exception is thrown by read() method?

A. IOException

B. InterruptedException

C. SystemException

D. SystemInputException
o m
.c
Answer: A
te
a
M
77. Which is the super class of all exception classes
q
A. Exception c
B. Object
M
C. Error

D. Throwable

Answer: D

78. Which class is the super class of all classes of the java.lang package?

A. Object

B. System

C. Super

D. Class

Answer: A

79. Which of the following exception is raised when a number is divided by


zero

A. NumberFormatException

Download more at McqMate.com


B. ArithmeticException

C. NullPointerException

D. IllegalArgumentException

Answer: B

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

A. finally

B. catch
o m
C. catch or finally
.c
te
D. None of the mentioned
a
Answer: C
q M
c
M
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

83. Thread priority in Java is represented as?

Download more at McqMate.com


A. int

B. Float

C. double

D. long

Answer: A

84. Which of these class is used to make a thread?

A. String
o m
B. System
.c
te
C. Thread
a
D. Runnable
q M
Answer: C
c
M
85. Which of these interface is implemented to create a Thread?

A. Runnable

B. Connections

C. Set

D. 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. getThreadPriority()

Answer: C

Download more at McqMate.com


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

o m
.c
88. Which method in Thread class is used to check weather a thread is still
running?
te
a
A. isAlive()
q M
B. Join() c
C. isRunning() M
D. Alive()

Answer: A

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()

Download more at McqMate.com


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()
o m
Answer: D
.c
te
92. Which of these classes is used toaread characters and strings in Java
from console?
q M
c
A. BufferedReader

B. StringReader
M
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

Download more at McqMate.com


C. BufferedOutputStream

D. PrintStream

Answer: D

95. Which of these methods can be used to write console output?

A. printout()

B. println()

C. write()
o m
D. All of the mentioned
.c
te
Answer: B
a
q M
96. Which of these classes are used by character streams output
operations? c
A. OutputStream
M
B. Writer

C. ReadStream

D. InputOutputStream

Answer: B

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

98. Java Stream classes can be categorized into two groups:

Download more at McqMate.com


A. Byte and Character Stream Classes

B. Stream and String Classes

C. String and Character Stream Classes

D. Buffer and Character Stream Classes

Answer: A

99. Byte Stream Classes support input/output operations on _____

A. 8 bit
o m
B. 16 bit
.c
te
C. 32 bit
a
D. 64 bit
q M
Answer: A
c
M
100. Character Stream Classes support input/output operations on
_______ characters:

A. 8 bit Unicode

B. 16 bit Unicode

C. 32 bit Unicode

D. 64 bit Unicode

Answer: B

Download more at McqMate.com


Take Quick Mock/Practice test on this topic HERE

For Discussion / Reporting / Correction of any MCQ please visit discussion page by clicking on
'answer' of respective MCQ.

McqMate is also available on

PlayStore

o m
.c
te
a
q M
c
M

Download more at McqMate.com

You might also like