This program demonstrates that the instance variables of object1 and object2 are identical.
The output is shown here:
object1: s=Hello; i=-7; d=2.7E10
object2: s=Hello; i=-7; d=2.7E10
Stream Benefits
The streaming interface to I/O in Java provides a clean abstraction for a complex and often
cumbersome task. The composition of the filtered stream classes allows you to dynamically
build the custom streaming interface to suit your data transfer requirements. Java programs
written to adhere to the abstract, high-level InputStream, OutputStream, Reader, and
Writer classes will function properly in the future even when new and improved concrete
stream classes are invented. As you will see in the next chapter, this model works very well
when we switch from a file systembased set of streams to the network and socket streams.
Finally, serialization of objects plays an important role in many types of Java programs.
Java's serialization I/O classes provide a portable solution to this sometimes tricky task.
Search WWH :
Custom Search
Previous Page
Java SE 6 Topic Index
Next Page
Java SE 6 Bookmarks