Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

Which of these values is returned by read() method is end of file (EOF) is encountered?

Answer»

Which of these values is returned by read() method is END of file (EOF) is ENCOUNTERED?
Choose the CORRECT options from below list
(1)0
(2)1
(3)-1
(4)Null

Answer:-(3)-1

2.

Which of these methods are used to read in from file?

Answer»

Which of these methods are USED to READ in from file?
CHOOSE the correct options from below LIST
(1)get()
(2)read()
(3)scan()
(4)readFileInput()

Answer:-(2)read()

3.

Which of these is used to perform all input & output operations in Java?

Answer»

Which of these is used to perform all input & output operations in Java?
Choose the CORRECT options from below list
(1)classes
(2)Variables
(3)streams
(4)Methods

ANSWER:-(3)streams

4.

Which of these exception is thrown in cases when the file specified for writing is not found?

Answer»

Which of these exception is thrown in cases when the file SPECIFIED for WRITING is not found?
Choose the CORRECT options from below list
(1)IOException
(2)FileException
(3)FileNotFoundException
(4)FileInputException

Answer:-(3)FileNotFoundException

5.

Which of these modifiers can be used for a variable so that it can be accessed from any thread or parts of a program?

Answer»

Which of these modifiers can be used for a variable so that it can be accessed from any THREAD or parts of a PROGRAM?
Choose the correct OPTIONS from below list
(1)transient
(2)No modifier is needed
(3)global
(4)VOLATILE

Answer:-(4)volatile

6.

Which of these class contains the methods used to write in a file?

Answer»

Which of these class contains the methods used to write in a file?
Choose the correct options from below list
(1)FILESTREAM
(2)FILEINPUTSTREAM
(3)BufferedOutputStream
(4)FileBufferStream

Answer:-(2)FileInputStream

7.

Which exception is thrown by read() method?

Answer»

Which EXCEPTION is THROWN by read() method?
CHOOSE the correct options from below list
(1)IOException
(2)INTERRUPTEDEXCEPTION
(3)SystemException
(4)SystemInputException

Answer:-(1)IOException

8.

Which of these classes are used by Byte streams for input and output operation?

Answer»

Which of these classes are used by Byte streams for input and output operation?
Choose the correct OPTIONS from below LIST
(1)InputStream
(2)INPUTOUTPUTSTREAM
(3)Reader
(4)All of the mentioned

Answer:-(1)InputStream

9.

What does AWT stands for?

Answer»

What does AWT STANDS for?
CHOOSE the correct OPTIONS from below list
(1)All Window Tools
(2)All Writing Tools
(3)ABSTRACT Writing Toolkit
(4)Abstract Window Toolkit

Answer:-(4)Abstract Window Toolkit

10.

Which of these class is used to read characters and strings in Java from console?

Answer»

Which of these class is used to read characters and STRINGS in Java from console?
CHOOSE the correct options from below list
(1)STRINGREADER
(2)BufferedReader
(3)BufferedStreamReader
(4)InputStreamReader

Answer:-(2)BufferedReader

11.

Which of these methods can be used to output a string in an applet?

Answer»

Which of these methods can be used to output a STRING in an APPLET?
Choose the CORRECT options from below LIST
(1)display()
(2)drawString()
(3)print()
(4)transient()

Answer:-(2)drawString()

12.

Which of these classes are used by character streams for input and output operations?

Answer»

Which of these classes are USED by CHARACTER streams for input and output operations?
Choose the CORRECT options from below list
(1)InputStream
(2)Writer
(3)READSTREAM
(4)InputOutputStream

Answer:-(2)Writer

13.

Which of these methods is a part of Abstract Window Toolkit (AWT)?

Answer»

Which of these methods is a part of Abstract WINDOW Toolkit (AWT)?
Choose the correct options from below list
(1)display()
(2)transient()
(3)DRAWSTRING()
(4)paint()

Answer:-(4)paint()

14.

Which of these exception is thrown by close() and read() methods?

Answer»

Which of these exception is thrown by CLOSE() and read() METHODS?
CHOOSE the correct OPTIONS from below list
(1)IOException
(2)FileException
(3)FileNotFoundException
(4)FileInputOutputException

Answer:-(1)IOException

15.

Which of these is used to read a string from the input stream?

Answer»

Which of these is used to READ a string from the INPUT stream?
Choose the correct options from below list
(1)get()
(2)getLine()
(3)read()
(4)readLine()

Answer:-(3)read()