Java Programming Language
Essay by review • December 5, 2010 • Research Paper • 8,690 Words (35 Pages) • 3,823 Views
INTRODUCTION
Java is an object-oriented programming language developed by James Gosling and colleagues at Sun Microsystems in the early 1990s. Unlike conventional languages which are generally designed to be compiled to native code, Java is compiled to a bytecode which is then run (generally using JIT compilation) by a Java virtual machine.
The language itself borrows much syntax from C and C++ but has a much simpler object model and does away with low level tools like programmer-manipulable pointers.
Java is only distantly related to JavaScript, though they have similar names and share a C-like syntax.
As with other parts of the Java platform, the Java language has evolved over the years while largely maintaining backwards compatibility.
JDK 1.0 (January 23, 1996) ЎЄ Initial release. [press release]
JDK 1.1 (February 19, 1997) [press release]
inner classes added to the language
J2SE 1.2 (December 8, 1998) ЎЄ Codename Playground. This and subsequent releases through J2SE 5.0 were rebranded Java 2 and the version name "J2SE" (Java 2 Platform, Standard Edition) replaced JDK to distinguish the base platform from J2EE (Java 2 Platform, Enterprise Edition) and J2ME (Java 2 Platform, Micro Edition). Major additions included: [press release]
strictfp keyword
J2SE 1.3 (May 8, 2000) ЎЄ Codename Kestrel. [press release]
J2SE 1.4 (February 6, 2002) ЎЄ Codename Merlin. This was the first release of the Java platform developed under the Java Community Process as JSR 59. Major changes included: [press release]
J2SE 5.0 (September 30, 2004) ЎЄ Codename Tiger. (Originally numbered 1.5, which is still used as the internal version number.[1]) Developed under JSR 176, Tiger added a number of significant new language features: [press release]
Generics ЎЄ provides compile-time (static) type safety for collections and eliminates the need for most typecasts. (Specified by JSR 14.)
Metadata ЎЄ also called annotations, allows language constructs such as classes and methods to be tagged with additional data, which can then be processed by metadata-aware utilities. (Specified by JSR 175.)
Autoboxing/unboxing ЎЄ automatic conversions between primitive types (such as int) and primitive wrapper classes (such as Integer). (Specified by JSR 201.)
Enumerations ЎЄ the enum keyword creates a typesafe, ordered list of values (such as Day.MONDAY, Day.TUESDAY, etc.). Previously this could only be achieved by non-typesafe constant integers or manually constructed classes (typesafe enum pattern). (Specified by JSR 201.)
Varargs ЎЄ the last parameter of a method can now be declared using a type name followed by three dots (e.g. void drawtext(String... lines)). In the calling code any number of parameters of that type can be used and they are then placed in an array to be passed to the method.
Enhanced for loop ЎЄ the for loop syntax is extended with special syntax for iterating over each member of either an array or any Iterable, such as the standard Collection classes, using a construct of the form:
---------------------------------------------------|
void displayWidgets (Iterable widgets) { |
for (Widget w : widgets) { |
w.display(); |
} |
} |
---------------------------------------------------|
This example iterates over the Iterable object widgets, assigning each of its items in turn to the variable w, and then calling the Widget method display() for each item. (Specified by JSR 201.)
Java SE 6 ЎЄ Codename Mustang. As of 2006 this is currently in development under JSR 270. A beta version was released on February 15, 2006[press release] and is available at . Another beta is expected summer 2006 with the final release in autumn 2006. New builds including enhancements and bug fixes are released approximately weekly. As of this version, Sun replaced the name "J2SE" with Java SE and dropped the ".0" from the version number.[2]
Java SE 7 ЎЄ Codename Dolphin. As of 2006, this is in the early planning stages. Development is expected to begin in spring 2006, with release estimated in 2008.[3]
In addition to the language changes, much more dramatic changes have been made to the Java class library over the years, which has grown from a few hundred classes in JDK 1.0 to over three thousand in J2SE 5.0. Entire new APIs, such as Swing and Java2D, have been introduced, and many of the original JDK 1.0 classes and methods have been deprecated.
PHILOSOPHY
There were five primary goals in the creation of the Java language:
1. It should use the object-oriented programming methodology.
2. It should allow the same program to be executed on multiple operating systems.
3. It should contain built-in support for using computer networks.
4. It should be designed to execute code from remote sources securely.
5. It should be easy to use and borrow the good parts of older object-oriented languages like C++.
To achieve the goals of networking support and remote code execution, Java programmers sometimes find it necessary to use extensions such as CORBA, Internet Communications Engine, or OSGi.
Object orientation
The first characteristic, object orientation ("OO"), refers to a method of programming and language design. Although there are many interpretations of OO, one primary distinguishing idea is to design software so that the various types of data it manipulates are combined together with their relevant operations. Thus, data and code are combined into entities called objects. An object can be thought of as a self-contained bundle of behavior (code) and state (data). The principle is to separate the things that change
...
...