2: Everything is an object

CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.

Bruce Eckel’s Thinking in Java Contents | Prev | Next

is
an object

Although
it is based on C++, Java is more of a “pure” object-oriented
language.

Both
C++ and Java are hybrid languages, but in Java the designers felt that the
hybridization was not as important as it was in C++. A hybrid language allows
multiple programming styles; the reason C++ is hybrid is to support backward
compatibility with the C language. Because C++ is a superset of the C language,
it includes many of that language’s undesirable features which can make
some aspects of C++ overly complicated.

The
Java language assumes that you want to do only object-oriented programming.
This means that before you can begin you must shift your mindset into an
object-oriented world (unless it’s already there)
.
The benefit of this initial effort is the ability to program in a language that
is simpler to learn and to use than many other OOP languages. In this chapter
we’ll see the basic components of a Java program and we’ll learn
that everything in Java is an object, even a Java program.

More by Author

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Must Read