Java as a Programming Language

Java as a Programming Language - Hello friends JAVA Programming for Engineers, On this occasion I will discuss the article entitled Java as a Programming Language, I have provided various other latest articles. hopefully the article that I wrote is useful for you all..

Written by : JAVA Programming for Engineers
Title : Java as a Programming Language

see also


Java as a Programming Language



One reason for Java’s success is that if you already know C or C++, Java is
easy to learn. By the same token, if you learn Java as your first language,
you will later be able to pick up C and C++ without much effort. Java is de-
scribed as an interpreted, object-oriented, strongly typed language that re-
lies heavily on support libraries. These characteristics of Java are
discussed in the following sections.

Java is object-oriented

An object is a program element that contains both data and code. The ratio-
nale for objects is that data is useful if there are operations that can be used
to transform it. For example, we find it useful to store numbers in a com-
puter system because there are operations that can be performed on these
numbers. A computer program stores the hourly wage of a company’s em-
ployees because it can later calculate the gross pay of each individual by
multiplying the hourly wage by the number of hours worked. What use
would it be to store numbers in a computer system that cannot perform
arithmetic?

Object-oriented programming (OOP) views a software system as a col-
lection of classes of objects. Each object class is a self-contained unit of
data and the processing operations that can be applied to this data. You
can image a payroll program that contains a class called Wage-
EarningEmployee. The objects of the class are the individual wage earn-
ers employed by the company. In this sense Joe Smith, who makes wages
of $18.25 per hour as a carpenter, is an object of the class
WageEarningEmployee. The class contains data elements for storing the
name and address, hourly wage, number of hours worked, number of de-
pendents, and all other information necessary for managing the payroll. In
addition, the class WageEarningEmployee also contains programming
routines (called methods) for calculating wages, paying taxes, printing
checks, and performing other necessary data manipulations. Other
classes of the payroll software system may be called SalariedEmployee,
AdministrativeStaff, and Executives. Each class would hold the data and
processing elements necessary for each employee type.

Programmers note:
As an object-oriented language, Java resembles Smalltalk. Smalltalk
was developed at the Xerox Palo Alto Research Center (PARC) and
first released in 1980. Although Smalltalk has never been very popu-
lar, it is considered a model for object-oriented programming lan-
guages. Java supports inheritance, encapsulation, and polymorphis,
the cornerstones of object-oriented systems.

Java is strongly-typed

Java is described as a strongly-typed language. This means that all data
must belong to a specific type and that the data type cannot be changed
whiletheprogramisexecuting.Forexample,wholenumbersbelongtoone
data type and fractional numbers to another one.

To understand the notion of a strongly-typed language you can imagine
a data type named int, that is intended for storing integer (whole) num-
bers, and another type named float, designed for storing fractional num-
bers. (It just happens that the int and float data types actually exist in
Java.) In this language, we could use the int type to store the number of
dependents of an employee since this value would always be a whole
number; while the employee’s hourly wage, which could be a fraction,
would be stored in a type float. Now suppose that an employee, for tax
purposes, wanted to claim a fractional number of dependents, say 2.5. If
the language is strongly-typed it would not be possible to store a frac-
tional number in a data element of int type. A weakly-typed language, on
the other hand, would allow storing a fractional number in an integer data
type. Java is defined as strongly-typed because each data element must be
consistent with the type of the data container that holds it. Strongly typed
languages are said to be more reliable.


Thus our article entitled Java as a Programming Language,do you like the article hopefully this article can benefit you all.

You are reading the article Java as a Programming Language and this article the permalink url is https://javaprogrammingengineers.blogspot.com/2014/06/java-as-programming-language.html Other articles you are looking for xxxxx
,Java as a Programming Language xxx .

0 Response to "Java as a Programming Language"

Posting Komentar