Java Reference
In-Depth Information
b. Generally, each language instruction in this type of language
corresponds to an equivalent machine language instruction.
c. Most programmers write their programs using this type of
language.
d. Java is an example of this type of language.
e. This type of program translates code in one language to code in
another language.
f. This type of program interweaves the translation of code and the
execution of the code.
SR 1.31 What do we mean by the syntax and semantics of a programming
language?
SR 1.32 Categorize each of the following situations as a compile-time error,
run-time error, or logical error.
a. Misspelling a Java reserved word.
b. Calculating the average of an empty list of numbers by dividing
the sum of the numbers on the list (which is zero) by the size of
the list (which is also zero).
c. Printing a student's high test grade when the student's average test
grade should have been output.
1.6 Object-Oriented Programming
As we stated earlier in this chapter, Java is an object-oriented (OO) language. As
the name implies, an object is a fundamental entity in a Java program. This topic
is focused on the idea of developing software by defining objects that interact
with each other.
The principles of object-oriented software development have been around for
many years, essentially as long as high-level programming languages have been
used. The programming language Simula, developed in the 1960s, had many
characteristics that define the modern OO approach to software development.
In the 1980s and 1990s, object-oriented programming became wildly popular,
due in large part to the development of programming languages such as C++ and
Java. It is now the dominant approach used in commercial software development.
One of the most attractive characteristics of the object-oriented approach is the
fact that objects can be used quite effectively to represent real-world entities. We
can use a software object to represent an employee in a company, for instance.
We'd create one object per employee, each with behaviors and characteristics that
we need to represent. In this way, object-oriented programming allows us to map
 
Search WWH ::




Custom Search