Skip to main content

Input Output — Part 1 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on Input Output — Part 1 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.

Questions
40
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
48 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
40

Verified Practice Questions

Interactive test mode with detailed academic worked solutions

Live Progress | 0/40 answered
✓ 0 correct ✗ 0 wrong 0% score
Question 1 of 40
★ FPSC ★ PPSC

When comparing java.io.BufferedWriter and java.io.FileWriter, which capability exist as a method in only one of two ?

Question 2 of 40
★ FPSC ★ PPSC

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

Question 3 of 40
★ FPSC ★ PPSC

What is the length of the application box made by the following Java program? import java.awt.*; import java.applet.*; public class myapplet extends Applet { public void paint(Graphics g) { g.drawString("A Simple Applet", 20, 20); } }

Question 4 of 40
★ FPSC ★ PPSC

Which class is used to read data from the keyboard in Java?

Question 5 of 40
★ FPSC ★ PPSC

What is the purpose of the `System.out.println()` method in Java?

Question 6 of 40
★ FPSC ★ PPSC

Which method is used to write data to a file in Java?

Question 7 of 40
★ FPSC ★ PPSC

How can you close a file after reading or writing in Java?

Question 8 of 40
★ FPSC ★ PPSC

What is the purpose of the `FileInputStream` class in Java?

Question 9 of 40
★ FPSC ★ PPSC

Which class is used to read data from a file in Java?

Question 10 of 40
★ FPSC ★ PPSC

What is the purpose of the `BufferedReader` class in Java?

Question 11 of 40
★ FPSC ★ PPSC

Which method is used to read a line of text from the keyboard in Java?

Question 12 of 40
★ FPSC ★ PPSC

In Java, what does the `FileOutputStream` class do?

Question 13 of 40
★ FPSC ★ PPSC

What is the purpose of the `PrintWriter` class in Java?

Question 14 of 40
★ FPSC ★ PPSC

Which class is used to write binary data to a file in Java?

Question 15 of 40
★ FPSC ★ PPSC

In Java, which method is used to write binary data to a file?

Question 16 of 40
★ FPSC ★ PPSC

What is the purpose of the `FileWriter` class in Java?

Question 17 of 40
★ FPSC ★ PPSC

Which class is used to write formatted text to a file in Java?

Question 18 of 40
★ FPSC ★ PPSC

In Java, what is the primary purpose of the `DataInputStream` class?

Question 19 of 40
★ FPSC ★ PPSC

In Java, what does the `DataOutputStream` class do?

Question 20 of 40
★ FPSC ★ PPSC

Which class is used to write primitive data types to an output stream in Java?

Question 21 of 40
★ FPSC ★ PPSC

What is the purpose of the `RandomAccessFile` class in Java?

Question 22 of 40
★ FPSC ★ PPSC

In Java, which class is used to read and write character streams?

Question 23 of 40
★ FPSC ★ PPSC

What is the primary purpose of the `File` class in Java?

Question 24 of 40
★ FPSC ★ PPSC

In Java, how can you check if a file or directory exists using the `File` class?

Question 25 of 40
★ FPSC ★ PPSC

Which method is used to delete a file or directory in Java?

Question 26 of 40
★ FPSC ★ PPSC

In Java, what is the purpose of the `File.separator` constant?

Question 27 of 40
★ FPSC ★ PPSC

What is the difference between character streams and byte streams in Java?

Question 28 of 40
★ FPSC ★ PPSC

In Java, what is the purpose of the `BufferedWriter` class?

Question 29 of 40
★ FPSC ★ PPSC

Which class is used for reading character streams in a platform-independent way in Java?

Question 30 of 40
★ FPSC ★ PPSC

In Java, what is the primary purpose of the `PrintStream` class?

Question 31 of 40
★ FPSC ★ PPSC

What is the difference between reading and writing character streams in Java?

Question 32 of 40
★ FPSC ★ PPSC

In Java, which class is used to read binary data from an input stream?

Question 33 of 40
★ FPSC ★ PPSC

What is the purpose of the `Console` class in Java?

Question 34 of 40
★ FPSC ★ PPSC

System class is defined in .................

Question 35 of 40
★ FPSC ★ PPSC

Which of these classes defined in java.io and used for file-handling are abstract? A. InputStream B. PrintStream C. Reader D. FileInputStream E. FileWriter

Question 36 of 40
★ FPSC ★ PPSC

What does AWT stands for?

Question 37 of 40
★ FPSC ★ PPSC

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

Question 38 of 40
★ FPSC ★ PPSC

Which of these is a type of stream in Java?

Question 39 of 40
★ FPSC ★ PPSC

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

Question 40 of 40
★ FPSC ★ PPSC

Which of these class is used to read from byte array?

✓ Link copied to clipboard
Continue Your Practice

Advance Html — Part 1

Master the next curriculum module with 40 exam-standard MCQs.

Next Practice Set →

💡 Examiner's Advisory for Programming & Software Development

In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.

More Modules in Programming & Software Development

View All →
📚

Study Guides

Topic summaries and syllabus breakdown

Explore Guides →
🎯

Complete Library

Search through 78,000+ verified MCQs

Browse Library →
📱

Mobile App

Offline mock tests and instant bookmarks

Get Mobile App →