Entrance Exams
Govt. Exams
InvalidClassException is thrown when a serialized object's serialVersionUID doesn't match the current class definition, indicating an incompatible class version.
Reading each line requires processing each character once, resulting in O(n) complexity where n is total characters.
SequenceInputStream concatenates multiple input streams, allowing them to be read as one continuous stream.
PrintWriter suppresses IOException and continues silently, unlike other streams.
serialVersionUID identifies class versions. Mismatched versions cause InvalidClassException during deserialization.
BufferedReader buffers input, reducing system calls and I/O overhead, improving performance significantly.
Externalizable requires implementation of writeExternal() and readExternal() for complete control over serialization.
reset() clears ObjectOutputStream's internal cache of serialized objects, allowing duplicate objects to be serialized again.
Transient fields are excluded from serialization and are initialized to default values upon deserialization.
DataInputStream with buffering allows sequential reading without loading the entire file into memory, making it ideal for large files.