Menu
Popular Courses
Search

MCQs


Total Questions : 18 | Page 1 of 2 pages
Question 1. Which of these packages contain classes and interfaces used for input & output operations of a program?
  1.    java.util
  2.    java.lang
  3.    java.io
  4.    All of the mentioned
 Discuss Question
Answer: Option C. -> java.io


java.io provides support for input and output operations.


Question 2. Which of these is specified by a File object?
  1.    a file in disk
  2.    directory path
  3.    directory in disk
  4.    None of the mentioned
 Discuss Question
Answer: Option C. -> directory in disk


directory in disk


Question 3. Which of these interface is not a member of java.io package?
  1.    DataInput
  2.    ObjectInput
  3.    ObjectFilter
  4.    FileFilter
 Discuss Question
Answer: Option C. -> ObjectFilter


ObjectFilter


Question 4. Which of these class is not related to input and output stream in terms of functioning?
  1.    File
  2.    Writer
  3.    InputStream
  4.    Reader
 Discuss Question
Answer: Option A. -> File


A File describes properties of a file, a File object is used to obtain or manipulate the information associated with a disk file, such as the permissions, time date, and directories path, and to navigate subdirectories.


Question 5. Which of these class is not a member class of java.io package?
  1.    String
  2.    StringReader
  3.    Writer
  4.    File
 Discuss Question
Answer: Option A. -> String


String


Question 6. Which of these is method for testing whether the specified element is a file or a directory?
  1.    IsFile()
  2.    isFile()
  3.    Isfile()
  4.    isfile()
 Discuss Question
Answer: Option B. -> isFile()


isFile() returns true if called on a file and returns false when called on a directory.


Question 7. Which of these class is used to read and write bytes in a file?
  1.    FileReader
  2.    FileWriter
  3.    FileInputStream
  4.    InputStreamReader
 Discuss Question
Answer: Option C. -> FileInputStream


FileInputStream


Question 8. Which of these classes is used for input and output operation when working with bytes?
  1.    InputStream
  2.    Reader
  3.    Writer
  4.    All of the mentioned
 Discuss Question
Answer: Option A. -> InputStream


InputStream & OutputStream are designed for byte stream. Reader and writer are designed for character stream.


Question 9. Which of these method of InputStream is used to read integer representation of next available byte input?
  1.    read()
  2.    scanf()
  3.    get()
  4.    getInteger()
 Discuss Question
Answer: Option A. -> read()


read()


Question 10. Which of these data type is returned by every method of OutputStream?
  1.    int
  2.    float
  3.    byte
  4.    None of the mentioned
 Discuss Question
Answer: Option D. -> None of the mentioned


Every method of OutputStream returns void and throws an IOExeption in case of errors.


Share this page with your friends!

Share this page with your friends!

Latest Videos

Chapter 1 - GLOBAL STEEL SCENARIO & INDI Part 1 : (13-04-2024) INDUSTRY AND COMPANY AWARENESS (ICA)
Direction Sense Test Part 1 Reasoning (Hindi)
Chapter 1 - RMHP / OHP / OB & BP Part 1 : (14-02-2024) GPOE
Cube & Cuboid Part 1 Reasoning (Hindi)
Data Interpretation (DI) Basic Concept Reasoning (Hindi)
Counting Figures Part 1 Counting Of Straight Lines Reasoning (Hindi)
Real Numbers Part 7 Class 10 Maths
Real Numbers Part 1 Class 10 Maths
Polynomials Part 1 Class 10 Maths

Latest Test Papers

Chapter 3.1 : Overview of Finance & Acco Chapter 3 : Finance & Accounts SAIL E0 - GFM 2024
Chapter 2.1 : Overview Chapter 2 : Materials Management SAIL E0 - GFM 2024
Chapter 1.1 : Personnel Functions- An ov Chapter 1 : Personnel Management SAIL E0 - GFM 2024
GPOE / GPA Combined 1 Free CBT Mock Test SAIL E0 2024
CBT Mixed Test 1 GPOE/GPA SAIL E0 2024