Java Reference
In-Depth Information
DAY 16:
Serializing and
Examining Objects
An essential concept of object-oriented programming is the representa-
tion of data. In an object-oriented language such as Java, an object repre-
sents two things:
Behavior—The things an object can do
n
Attributes—The data that differentiates the object from other
objects
n
Combining behavior and attributes is a departure from other programming
languages where a program is defined as a set of instructions that
manipulate data. The data is a separate thing, as in word processing
software. Most word processors are considered programs used to create
and edit text documents.
Object-oriented programming blurs the line between program and data. An
object in a language such as Java encapsulates both instructions (behav-
ior) and data (attributes).
Today, you discover two ways that a Java program can take advantage of
this representation:
Object serialization—The capability to read and write an object
using streams
n
Reflection—The capability of one object to learn details about
another object
n
 
Search WWH ::




Custom Search