Skip to main content

Java Serialization And Networking — Part 1 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on Java Serialization And Networking — 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

What will be the output of the following Java code? import java.net.*; class networking { public static void main(String[] args) throws MalformedURLException { URL obj = new URL("https://www.example.com/javamcq"); System.out.print(obj.getProtocol()); } }

Question 2 of 40
★ FPSC ★ PPSC

What is Java Serialization?

Question 3 of 40
★ FPSC ★ PPSC

Which interface in Java is used to mark a class as serializable?

Question 4 of 40
★ FPSC ★ PPSC

What is the purpose of the `ObjectOutputStream` class in Java Serialization?

Question 5 of 40
★ FPSC ★ PPSC

In Java Serialization, what is the purpose of the `transient` keyword when applied to an instance variable?

Question 6 of 40
★ FPSC ★ PPSC

What is deserialization in Java Serialization?

Question 7 of 40
★ FPSC ★ PPSC

Which class in Java is responsible for deserialization during Java Serialization?

Question 8 of 40
★ FPSC ★ PPSC

In Java Networking, what is the purpose of the `Socket` class?

Question 9 of 40
★ FPSC ★ PPSC

What is a port number in Java Networking?

Question 10 of 40
★ FPSC ★ PPSC

Which class in Java Networking is used to represent a server socket that listens for incoming client connections?

Question 11 of 40
★ FPSC ★ PPSC

In Java Networking, what is the purpose of the `URL` class?

Question 12 of 40
★ FPSC ★ PPSC

Which protocol is commonly used for sending emails in Java Networking?

Question 13 of 40
★ FPSC ★ PPSC

In Java Networking, what is the purpose of the `HttpURLConnection` class?

Question 14 of 40
★ FPSC ★ PPSC

What is the primary use of the `DatagramSocket` class in Java Networking?

Question 15 of 40
★ FPSC ★ PPSC

In Java Networking, what is the purpose of the `InetAddress` class?

Question 16 of 40
★ FPSC ★ PPSC

What is a datagram in Java Networking?

Question 17 of 40
★ FPSC ★ PPSC

In Java Networking, what is the purpose of the `DatagramPacket` class?

Question 18 of 40
★ FPSC ★ PPSC

Which class in Java Networking is used for reading and writing streams of bytes?

Question 19 of 40
★ FPSC ★ PPSC

What is the purpose of the `URLConnection` class in Java Networking?

Question 20 of 40
★ FPSC ★ PPSC

Which protocol is commonly used for file transfer in Java Networking?

Question 21 of 40
★ FPSC ★ PPSC

In Java Networking, what is the purpose of the `MulticastSocket` class?

Question 22 of 40
★ FPSC ★ PPSC

What is a multicast in Java Networking?

Question 23 of 40
★ FPSC ★ PPSC

In Java Serialization, what happens if a serialized class changes between serialization and deserialization?

Question 24 of 40
★ FPSC ★ PPSC

Which method is used to customize the serialization process in Java?

Question 25 of 40
★ FPSC ★ PPSC

In Java Serialization, what is the purpose of the `serialVersionUID` field?

Question 26 of 40
★ FPSC ★ PPSC

What is the purpose of the `java.net` package in Java?

Question 27 of 40
★ FPSC ★ PPSC

Which Java class is used to represent a URL (Uniform Resource Locator)?

Question 28 of 40
★ FPSC ★ PPSC

In Java Networking, what is the purpose of the `ServerSocket` class?

Question 29 of 40
★ FPSC ★ PPSC

Which protocol is commonly used for web communication in Java Networking?

Question 30 of 40
★ FPSC ★ PPSC

In Java Networking, which class is used for creating a UDP socket?

Question 31 of 40
★ FPSC ★ PPSC

What is the primary use of the `java.io` package in Java?

Question 32 of 40
★ FPSC ★ PPSC

Which of these methods is used to know the full URL of an URL object?

Question 33 of 40
★ FPSC ★ PPSC

Which of these is a process of writing the state of an object to a byte stream?

Question 34 of 40
★ FPSC ★ PPSC

Which of these methods is used to make raw MIME formatted string?

Question 35 of 40
★ FPSC ★ PPSC

Which of these method is used to start a server thread?

Question 36 of 40
★ FPSC ★ PPSC

Which of these method of httpd class is used to write UrlCacheEntry object into local disk?

Question 37 of 40
★ FPSC ★ PPSC

Which of the following methods is used to avoid serialization of new class whose super class already implements Serialization?

Question 38 of 40
★ FPSC ★ PPSC

Which of these class is used for operating on request from the client to the server?

Question 39 of 40
★ FPSC ★ PPSC

Which of these is a wrapper around everything associated with a reply from an http server?

Question 40 of 40
★ FPSC ★ PPSC

Default Serialization process cannot be overridden.

✓ 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 →