Java Reference
In-Depth Information
designed for programming home appliances, such as washing machines and televi-
sion sets. Although that may not be a very glamorous application area, it is no easy
task to design such a language. Home appliances are controlled by a wide variety of
computer processors (chips). The language that Gosling was designing needed to
work on all these different processors. Moreover, a home appliance is typically an
inexpensive item, so the manufacturer would be unwilling to invest large amounts
of money into developing complicated compilers. (A compiler is a program that
translates the program into a language the processor can understand.) To simplify
the tasks of writing compilers (translation programs) for each class of appliances, the
team used a two-step translation process. The programs are first translated into an
intermediate
language
intermediate language
that is the same for all appliances (or all computers), then a
small, easy-to-write, and hence inexpensive, program translates this intermediate
language into the machine language for a particular appliance or computer. This
intermediate language is called
byte-code
. Since there is
only one intermediate language, the hardest step of the two-step translation from
program to intermediate language to machine language is the same for all appliances
(or all computers), and hence, most of the cost of translating to multiple machine
languages was saved. The language for programming appliances never caught on
with appliance manufacturers, but the Java language into which it evolved has
become a widely used programming language.
Why call it
Java byte-code
or simply
byte-code
code
is commonly used to mean a program or part
of a program. A byte is a small unit of storage (eight bits to be precise). Computer-
readable information is typically organized into bytes. So the term
byte-code
? The word
code
byte-code
suggests a
program that is readable by a computer as opposed to a person.
In 1994, Patrick Naughton and Jonathan Payne at Sun Microsystems developed a
Web browser that could run (Java) programs over the Internet. That Web browser has
evolved into the browser known as HotJava. This was the start of Java's connection to
the Internet. In the fall of 1995, Netscape Incorporated made its Web browser capable
of running Java programs. Other companies followed suit and have developed soft-
ware that accommodates Java programs.
Objects and Methods
OOP
Java is an
. What is OOP?
The world around us is made up of objects, such as people, automobiles, buildings,
streets, adding machines, papers, and so forth. Each of these objects has the ability to
perform certain actions, and each of these actions has some effect on some of the other
objects in the world. OOP is a programming methodology that views a program as
similarly consisting of objects that interact with each other by means of actions.
Object-oriented programming has its own specialized terminology. The objects are
called, appropriately enough,
object-oriented programming
language, abbreviated
OOP
objects
. The actions that an object can take are called
object
method
class
methods
. Objects of the same kind are said to have the same
type
or, more often, are
said to be in the same
class
. For example, in an airport simulation program, all the
Search WWH ::




Custom Search