Java Reference
In-Depth Information
designed for programming home appliances, such as washing machines and television
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 translates a 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 that is the same
for all appliances (or all computers), and 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 Java byte-
code , or simply, 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); 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. Today, Java is
owned by Oracle Corporation, which purchased Sun Microsystems in 2010.
Why call it byte-code ? The word 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 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, which 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 software
that accommodates Java programs.
intermediate
language
byte-code
code
Objects and Methods
Java is an object-oriented programming (OOP) language. 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, objects . The actions that an object can take are called
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
OOP
object
method
class
 
Search WWH ::




Custom Search