Top 250+ Solved Java Programming MCQ Questions Answer
Q. Which of these class is not related to input and output stream in terms of functioning?
a. File
b. Writer
c. InputStream
d. Reader
Q. Standard output variable ‘out’ is defined in which class?
a. Void
b. Process
c. Runtime
d. System
Q. Which of these packages contains all the event handling interfaces?
a. javlang
b. java.awt
c. java.awt.event
d. java.event
Q. Which of these keywords is not a part of exception handling?
a. try
b. finally
c. thrown
d. catch
Q. Which of these exceptions handles the divide by zero error?
a. ArithmeticException
b. MathException
c. IllegalAccessException
d. IllegarException
Q. Which of these exceptions will occur if we try to access the index of an array beyond itslength?
a. ArithmeticException
b. ArrayException
c. ArrayIndexException
d. ArrayIndexOutOfBoundsException
Q. Which of the following will ensure the thread will be in running state?
a. yield()
b. notify()
c. wait()
d. ThreakillThread()
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 methods can be used to output a string in an applet?
a. display()
b. print()
c. drawString()
d. tr
Q. Which of these methods is a part of Abstract Window Toolkit (AWT) ?
a. display()
b. paint()
c. drawString()
d. tr
Q. Which of these operators can be used to get run time information about an object?
a. getInfo
b. Info
c. instanceof
d. getinfoof
Q. Which of these methods can be used to writing console output?
a. print()
b. println()
c. write()
d. all of the mentioned
Q. Which of these class is used to read from a file?
a. InputStream
b. BufferedInputStream
c. FileInputStream
d. BufferedFileInputStream
Q. Which of these events is generated by scroll bar?
a. ActionEvent
b. KeyEvent
c. WindowEvent
d. AdjustmentEvent