1.
Introduction to Java
➽ Introduction to Java
➽ The Origins of Java
Java was created in 1991 by James Gosling, Patrick Naughton, Chris Warth, Ed Frank,
and Mike Sheridan at Sun Microsystems. It was originally called “Oak”, but was
renamed “Java” in 1995.
Although Java became famous because of the Internet, it is interesting to note that
Java was not originally designed for the Internet. The main idea behind Java was to
develop a platform-independent programming language that could be used in consumer
electronic devices like toasters, microwave ovens, and remote controls. These
devices often used different types of CPUs to manage their operations, making it
challenging to develop software that was compatible with all of them.
At that time, most programming languages were compiled into machine code tailored
(specifically designed or adjusted) to a specific CPU. For example, C++ code could
be compiled to run on different CPUs, but each CPU required its own specific C++
compiler to execute the code. Creating these compilers was both costly and time-
consuming. To solve this issue, Gosling and his team started developing a portable,
cross-platform programming language that could generate code capable of running on
different CPUs across multiple environments. This effort eventually led to the
creation of Java.
Around the same time Java was being developed, the World Wide Web started to grow
rapidly. If the Web had not become popular, Java would likely have remained a
useful but little-known language used mainly for electronic devices. However, the
Web created a high demand for portable programs, which helped make Java widely
known and popular.
Most programmers understand early that making programs that work on any system is
very useful but also difficult. For a long time, this goal wasn’t a top priority
because other technical problems seemed more important. However, when the Internet
started growing, the problem of portability became much more serious. The Internet
connected many different types of computers, operating systems, and CPUs, so
writing code that could run on all of them became very important.
By 1993, the Java team realized that the same portability challenges they faced in
programming consumer electronics also existed in Internet programming. As a result,
the focus of Java shifted from electronic devices to the Internet. In short,
although Java was originally designed to be a platform-independent language, it was
the growth of the Internet that made it truly successful.
➽ Java’s Lineage: C and C++
New programming languages are not created in isolation; they build upon the ideas,
features, and experiences of earlier languages. Java is no exception — it is
strongly influenced by two major programming languages: C and C++.
Java inherits its core syntax (the rules for writing code) from C, which makes it
easier for programmers familiar with C to learn Java. Its object-oriented
programming features are influenced by C++, which added object-oriented
capabilities to the C language. This connection to C and C++ played an important
role in Java’s early adoption. When Java was introduced, many developers were
already experienced with C or C++. Because Java's syntax is similar, these
programmers could learn it quickly, which helped Java become popular in a short
time.
Another important point is that Java’s creators did not build the language entirely
from scratch. Instead, they based it on well-established concepts from C and C++,
enhancing them and adding new features to meet the needs of modern programming —
especially for internet and network-based applications. As a result, Java became a
powerful and reliable programming language that combines the strengths of earlier
languages while effectively addressing new challenges.
Because C, C++, and Java share many similarities, they create a common foundation
that benefits professional programmers. This allows developers to transition
between these languages more easily, without needing to relearn everything from the
beginning.
Java also shares another important characteristic with C and C++, — it was created
and improved by experienced programmers who understood real-world programming
challenges. This has made Java a practical and professional programming language,
well-suited for building reliable and complex software applications.
Finally, although Java and C++ are related (particularly in their support for
object-oriented programming) — Java is not just a web-based version of C++. It was
not designed to replacement or upgrade of C++. Instead, both languages were
designed to address different kinds of programming needs. That is why both C++ and
Java continue to be used today and are expected to remain important and widely used
for many years to come.
➽ How Java Impacted the Internet
The rise of the Internet played a major role in making Java popular, and Java, in
turn, had a strong influence on how the Internet evolved. First, Java made Internet
programming easier, attracting many developers to web development. Most
importantly, Java helped solve two major problems faced by Internet applications:
portability (the ability to run the same program on different systems) and
security. Second, it introduced a new kind of networked program called an applet,
which changed how people interacted with online content.
➼ Java Simplified Web-Based Programming
From the beginning, Java made it easier to build applications for the web. One of
its biggest strengths was the ability to create portable and cross-platform
programs—software that could run on any operating system without being rewritten.
Another key strength was Java’s built-in support for network programming. Its
standard library offered ready-to-use tools that helped developers write programs
that could easily connect to and interact with the Internet. Java also made it
simple to send programs over the Internet and run them on users' computers. These
features played a major role in Java’s rapid adoption.
➼ Java Applets
One of Java’s most exciting early features was the applet. An applet is a small
Java program designed to be downloaded and run directly inside a Java-enabled web
browser. When a user clicked a web link that contained an applet, it would
automatically download and run in their browser. Applets were often used for tasks
like displaying data, collecting user input, or performing simple functions like
loan calculations. What made applets special was that they ran locally on the
user’s computer, not on the server—this moved some processing work from the server
to the client machine.
Applets were important because they introduced a new type of web content: active
programs, not just static data. Normally, when you view a web page or read emails,
you are just seeing passive content. Even downloading a program doesn’t make it
active until you run it yourself. But an applet was different—it was downloaded as
a complete, self-running program. This gave websites new interactive capabilities
and showed what Java could do.
In Java’s early years, applets were widely used and played a big role in Java
programming. They added life to web pages and gave developers new possibilities.
However, over time, their importance declined. Starting with JDK 9, Java began to
phase out applet support, and by JDK 11, applets were officially removed.