WHAT IS JAVA Students Version
WHAT IS JAVA Students Version
Java is a programming language in the tradition of C and C++. As a result, if you have any
experience with C or C++, you’ll find yourself in familiar territory often as you learn the
various features of Java.
However, Java is different from other programming languages in some ways. The following
sections describe the most important differences.
Platform independence
A. An explanation on why Java is popular for programmers. One of the main reasons Java is
so popular is its platform independence. This means that Java programs can be run on
many different types of computers. A Java program runs on any computer with a Java
Runtime Environment, also known as a JRE, installed. A JRE is available for almost every
type of computer — PCs running Windows, Macintosh computers, Unix or Linux
computers, huge mainframe computers, and even cell phones.
Object orientation
B. Examples of objects. Java is object-oriented, in other words Java programs are composed
of programming elements called objects. In brief, an object is a programming entity that
represents some real-world object or an abstract concept.
BY: Andrés Felipe Lozano Arias
__________________________________________________________________
All objects have two basic characteristics:
Objects have data, also known as state. For instance, an object that represents a book has
data such as the book’s title, author, and publisher.
Objects also have behavior, so that they can perform certain tasks. In Java, these tasks are
called methods. For example, an object that represents a car can have methods such as
start, stop, drive, or crash. Some methods simply allow you to access the object’s data. For
example, a book object can have a getTitle method that tells you the book’s title.
C. How to use classes. Classes are related to objects. A class is the program code you write
to create objects. The class describes the data and methods that define the object’s
state and behavior. Later, when the program executes, classes are used to create
objects.
As an illustration, suppose you’re writing a payroll program. This program needs objects
to represent the company’s employees. So, the program includes a class (probably named
Employee) that defines the data and methods for each Employee object. So, when your
program runs, it uses this class to create an object for each of your company’s employees.