Introduction
The Java language was created in the early 90's as part of a software
development project for consumer electronic devices. The original new
object-oriented programming language was named Oak (oak) . With the
development of network Internet language Oak was used to create Internetapplications ( eg, n and this language was written Oak-browser " WebRunner
" ) . In 1995, Sun Microsystems decided to announce a new product,
renaming it Java (the only reasonable explanation for the name is the love of
coffee programmers) , and WebRunner was renamed HotJava .
The Java language is now increasingly used to create " middleware " that
maintains communication between clients and server resources . In addition,
the Java language has taken over the leadership in embedded systems ,
becoming the de facto standard for portable devices , on-board car computers,
and so on .
One of the main advantages of the Java language is independence from the
platform on which programs are executed: the same code can be run under
Windows , Solaris , Linux , Macintosh , etc. Operating systems . Another
advantage is that the syntax of the Java language is similar to the syntax
language s C ++ and C . In addition, Java is a completely object-oriented
language, even more so than C ++. All entities in the Java language are
objects, with the exception of a few primitive types , such as numbers.
In contrast to C ++ , it is easier to develop error-free programs in Java . The
Java language provides tools to eliminate the very possibility of creating
programs that would hide the most common errors. To do this, the Java
language has done the following :
The possibility of explicit allocation and freeing of memory has
been excluded. Java memory is automatically reclaimed by garbage
collection. The programmer is guaranteed against errors related to
misuse of memory ;
Introduced true arrays and disallowed pointer arithmetic. Now
programmers, in principle, cannot erase data from memory due to
improper use of pointers ;
Eliminated the possibility of confusing the assignment operator
with the equality comparison operator . Now you can not even
compile the expression of the if ( a = 3) { ... } (this error - the
source of most confusion in the languages C and C ++).
Multiple inheritance is excluded. It has been replaced by the
concept of interface a , borrowed from Objective C. An interface
gives the programmer almost everything a programmer can get from
multiple inheritance, while avoiding the complexity of managing
class hierarchies .