[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
JavaFAQ_WhatIsJava

(Java) What is Java?

Java, formerly known as Oak, it can be considered to be an object-oriented programming language developed by Sun Microsystems (www.sun.com). The Java programming language is currently shipping from Sun Microsystems, Inc. as the Java 2 SDK and Java 2 Runtime Environment. http://java.sun.com/j2se.

It shares many superficial similarities with C, C++, and Objective C (for instance for loops have the same syntax in all four languages); but it is not based on any of those languages. It can be considered to be the language of the Web or the Browser.

The language was originally created because C++ proved inadequate for certain responsibilities. Since the designers were not burdened with compatibility with existing languages, they were able to learn from the experience and mistakes of previous object-oriented languages. Few things were added, as compared to the C++ Garbage collection and  ?Multithreading; and they threw away C++ features that had proven to be better in theory than in practice like multiple inheritance and operator overloading.

The name was chosen during one of several brainstorming sessions held by the Java software team. They were aiming to come up with a name that evoked the essence of the technology -- liveliness, animation, speed, interactivity, and more. "Java" was chosen from among many, many suggestions. The name is not an acronym, but rather a reminder of that hot, aromatic stuff that many programmers like to drink lots of.

Even more importantly Java was designed from the ground up to allow for secure execution of code across a network, even when the source of that code was untrusted and possibly malicious. This required the elimination of more features of C and C++. Most notably there are no pointers in Java. Java programs cannot (at least in theory) access arbitrary addresses in memory.
Java was intended not only to be cross-platform in source form like C, but also in compiled binary form. Since this is frankly impossible across processor architectures, Java is compiled to an intermediate byte-code, which is interpreted in real time by the Java interpreter. Thus to port Java programs to a new platform all that is needed is a port of the interpreter and a few native code libraries.

Java was designed to make it a lot easier to write bug free code.
  • No unsafe constructs
  • The language is small so its easy to become fluent.
  • There seem no undefined or architecture dependent constructs. Its almost platform independent in the true sense.
  • Java is object oriented so reuse is easy.
The above mentioned website about the Java SDK contains:
  • Java Compiler
  • Java Virtual Machine JVM
  • Java Class Libraries
  • Java Applet Viewer
  • Java Debugger and other tools
  • Documentation
To run Java 1.0 applets, use Netscape Navigator 3.x or other browsers that support Java applets. To run Java 1.1.x applets, use HotJavaTM 1.x or Netscape Navigator 4.x or other browsers that support the newest version of the Java API.

Sun Microsystems provides ports of the Java 2 Platform for Windows 95, Windows 98, Windows NT, Windows 2000, Solaris-SPARC, Solaris-Intel, Windows XP and Linux. The official software home page of the creators of Java Technology is http://java.sun.com/.

Java is a programming language. When work began on what has become Java, the World Wide Web was just getting started at CERN. The original use of the Java language required security and the ability to execute code from untrusted hosts. It turns out these are virtually the same requirements for allowing people to download and run programs from the Web. No other language has the built-in security of Java.

The key Java where it succeed over the rest is the security features. The object-oriented nature of Java is secondary, and mainly reflects the preferences and prejudices of the developers who set out to write a secure language. The C-like syntax of the language is even less crucial.

At the lowest level the advantage of Java to the web is that it provides a secure, cross-platform way for code to be executed. Java adds several features to existing web sites:

Graphics
Java allows the host server/webpage to draw pictures in a window on the client. In theory this allows a web page to do anything a regular program can do by drawing in a window.

Data Types
In practice rather than using graphics primitives to create your desired web page you'd use a graphics program to draw the page and then write a program that could read and display the file formats of that program.

This way one can download data and the data display program rather than downloading a bitmapped snapshot of the display.

This is being used to add sound and animation to web pages. Rather than having to download a file and spawn an external viewer, the viewer is included with the data; and the data is displayed right on the page.

Server is more free so the site becomes kind of fast to load CPU intensive cgi-bin scripts place a large load on a server, particularly at busy sites. With Java you can off-load the calculations to the client's PC. Publishing this as a cgi-bin would bring my server to its grounds, but by publishing it as a Java applet one can distribute the load across all the machines that want to run it.

High Amount of User Interaction
Finally Java allows for more interaction with the user. Java not only allows you to paint arbitrary data on the screen, it also allows you to collect input from the user in the form of mouse clicks, keystrokes and the like. This lets you put almost any application on your web page that doesn't require disk access.

Coming to Javascript
JavaScript is a programming language from Netscape which is incorporated in their browsers. It is superficially similar to Java in the same way C is similar to Java but differs in all important respects.

Java Application and Applet Technically an application is a Java class that has a main() method. An applet is a Java class which extends java.applet.Applet. A class which extends java.applet.Applet and also has a main() method is both an application and an applet.

More generally and less technically an application is a stand-alone program, normally launched from the command line, and which has more or less unrestricted access to the host system. An applet is a program which is run in the context of an applet viewer or web browser, and which has strictly limited access to the host system. For instance, an applet can normally not read or write files on the host system whereas an application normally can.

The actions of both applets and applications, however, can be controlled by SecurityManager objects. If you can change the SecurityManager that's used you can change what an applet or an application is and is not allowed to do. Thus these are not hard and fast differences, though this is normally how they separate out in practice.

last edited (November 18, 2006) by bilderbikkel, Number of views: 3743, Current Rev: 5 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Tore Nestenius at .NET Consultant - Synchron Data.