Top 250+ Solved Java Programming MCQ Questions Answer
Q. Which of these methods is used to begin the execution of a thread?
a. run()
b. start()
c. runThread()
d. startThread()
Q. Which of these method waits for the thread to treminate?
a. sleep()
b. isAlive()
c. join()
d. stop()
Q. Which of these is used to read a string from the input stream?
a. get()
b. getLine()
c. read()
d. readLine()
Q. Which of these classes is used to read characters and strings in Java from console?
a. BufferedReader
b. StringReader
c. BufferedStreamReader
d. InputStreamReader
Q. Which of these classes are used by Byte streams for input operation?
a. InputStream
b. InputOutputStream
c. Reader
d. All of the mentioned
Q. Which of these class contains the methods print() & println()?
a. System
b. System.out
c. BufferedOutputStream
d. PrintStream
Q. Which of these methods can be used to write console output?
a. printout()
b. println()
c. write()
d. All of the mentioned
Q. Which of these classes are used by character streams output operations?
a. OutputStream
b. Writer
c. ReadStream
d. InputOutputStream
Q. Which refers to a channel through which data flow from the source to the destination:
a. String
b. Character
c. Stream
d. Buffer
Q. Java Stream classes can be categorized into two groups:
a. Byte and Character Stream Classes
b. Stream and String Classes
c. String and Character Stream Classes
d. Buffer and Character Stream Classes
Q. Byte Stream Classes support input/output operations on _____
a. 8 bit
b. 16 bit
c. 32 bit
d. 64 bit
Q. 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
Q. Java supports input/output of data through the classes included in the _______ package:a)jav
a. oi
b. java.out
c. java.in
d. java.io
Q. The ________ method help in clearing the contents of the buffer:
a. flush()
b. clear()
c. rub()
d. vanish()
Q. The _______ class is used to write bytes to a file:
a. FileInputStream
b. FileOutputStream
c. FileBufferStream
d. FileStringStream