Here is the list of Java IO interview questions:
- What is IO in Java?
- What is the difference between Reader/Writer and InputStream/OutputStream?
- What is a stream in Java?
- What is the difference between byte stream and character stream in Java?
- What are the differences between FileInputStream and FileReader?
- What is a buffer in Java IO and why is it used?
- What is serialization in Java IO?
- What is the purpose of ObjectInputStream and ObjectOutputStream in Java?
- What is the difference between Serializable and Externalizable in Java?
- How do you handle exceptions in Java IO?
- What is the purpose of the java.io.File class?
- What is the difference between the createNewFile() and mkdir() methods of the File class?
- How do you read and write data to a file in Java?
- What is a Java Scanner class, and how is it used for reading input?
- What is a Java BufferedReader, and how is it used for reading input?
- What is a Java BufferedWriter, and how is it used for writing output?
- What is a Java PrintWriter, and how is it used for writing output?
- What is the purpose of the RandomAccessFile class in Java IO?
- How do you read and write binary data in Java?
- What is the purpose of the java.nio package in Java?
- What is a Java Channel, and how is it used for data transfer?
- What is the difference between a Java Selector and a Java Channel?
- What is a Java ByteBuffer, and how is it used for data manipulation?
- What is the purpose of the java.nio.file package in Java?
- How do you use Java IO to read and write data from a network connection?
- What is the difference between a Java Socket and a Java ServerSocket?
- What is the purpose of the java.net package in Java?
- What is a Java URL, and how is it used for network connections?
- What is a Java HttpURLConnection, and how is it used for HTTP requests?
- What is a Java DatagramPacket, and how is it used for UDP data transfer?
Advance IO interview questions:
- What is the purpose of the java.util.zip package in Java IO?
- How do you use Java IO to work with compressed files?
- What is the purpose of the java.util.regex package in Java?
- How do you use Java IO to work with regular expressions?
- What is the difference between a Java InputStream and a Java Reader?
- What is the difference between a Java OutputStream and a Java Writer?
- How do you use Java IO to work with character encodings and character sets?
- What is the purpose of the java.util.Scanner class, and how is it used for input parsing?
- What is a Java ObjectInputStream, and how is it used for deserialization?
- What is a Java ObjectOutputStream, and how is it used for serialization?
- What is a Java DataInputStream, and how is it used for reading primitive data types?
- What is a Java DataOutputStream, and how is it used for writing primitive data types?
- What is the purpose of the java.nio.charset package in Java?
- How do you use Java IO to work with character encodings and character sets in a non-blocking manner?
- What is a Java FileChannel, and how is it used for file I/O in a non-blocking manner?
- What is the purpose of the java.nio.file.attribute package in Java?
- How do you use Java IO to work with file attributes?
- What is the purpose of the java.nio.channels package in Java?
- How do you use Java IO to work with sockets and channels in a non-blocking manner?
- What is a Java Pipe, and how is it used for inter-thread communication using Java IO?
