Table of Contents
Introduction :-
Java programming language was originally developed by Sun Microsystems which was initiated by James Gosling and released in 1995 as core component of Sun Microsystems’ Java platform (Java 1.0 [J2SE]).
As of December 2008, the latest release of the Java Standard Edition is 6 (J2SE). With the advancement of Java and its widespread popularity, multiple configurations were built to suite various types of platforms. Ex: J2EE for Enterprise Applications, J2ME for Mobile Applications.
Sun Microsystems has renamed the new J2 versions as Java SE, Java EE and Java ME respectively. Java is guaranteed to be Write Once, Run Anywhere.
Features of Java
- Object Oriented:
In Java, everything is an Object. Java can be easily extended since it is based on the Object model.
- Platform independent:
Unlike many other programming languages including C and C++, when Java is compiled, it is not compiled into platform specific machine, rather into platform independent byte code. This byte code is distributed over the web and interpreted by virtual Machine (JVM) on whichever platform it is being run.
- Simple:
Java is designed to be easy to learn. If you understand the basic concept of OOP Java would be easy to master.
- Secure:
With Java’s secure feature it enables to develop virus-free, tamper-free systems. Authentication techniques are based on public-key encryption.
- Architectural-neutral :
Java compiler generates an architecture-neutral object file format which makes the compiled code to be executable on many processors, with the presence of Java runtime system.
- Portable:
Being architectural-neutral and having no implementation dependent aspects of the specification makes Java portable. Compiler in Java is written in ANSI C with a clean portability boundary which is a POSIX subset.
- Robust:
Java makes an effort to eliminate error prone situations by emphasizing mainly on compile time error checking and runtime checking.
- Multithreaded:
With Java’s multithreaded feature it is possible to write programs that can do many tasks simultaneously. This design feature allows developers to construct smoothly running interactive applications.
- Interpreted:
Java byte code is translated on the fly to native machine instructions and is not stored anywhere. The development process is more rapid and analytical since the linking is an incremental and light weight process.
- High Performance:
With the use of Just-In-Time compilers, Java enables high performance.
- Distributed:
Java is designed for the distributed environment of the internet.
- Dynamic:
Java is considered to be more dynamic than C or C++ since it is designed to adapt to an evolving environment. Java programs can carry extensive amount of runtime information that can be used to verify and resolve accesses to objects on run-time.
History of Java:-
- James Gosling initiated the Java language project in June 1991 for use in one of his many set-top box projects. The language, initially called Oak after an oak tree that stood outside Gosling’s office, also went by the name Green and ended up later being renamed as Java, from a list of random words.
- Sun released the first public implementation as Java 1.0 in 1995. It promised Write Once, Run Anywhere (WORA), providing no-cost run-times on popular platforms.
- On 13 November 2006, Sun released much of Java as free and open source software under the terms of the GNU General Public License (GPL).
- On 8 May 2007, Sun finished the process, making all of Java’s core code free and open-source, aside from a small portion of code to which Sun did not hold the copyright.
Difference between Java and C++
Java is a true object-oriented language while C++ is basically C with object-oriented extension. Java appears to be similar to C++ when we consider only the “extension” part of C++. However, some object-oriented features of C++ make the C++ code extremely difficult to follow and maintain.
Listed below are some major C++ factures that were intentionally omitted from java or significantly modified.
- Java does not support operator overloading.
- Java does not have template classes in C++.
- Java does not support multiple inheritance of classes. This is accomplished using a new feature called “interface”.
- Java does not support global variables. Every variable and method is declared within a class and forms part of that class.
- Java does not use pointers.
- Java has replaced the destructor function with a finalize() function.
- There are no header files in java.
JAVA AND INTERNET:
Java is strongly associated with the internet because of the fact that the first application program written in java was Hot Java, a web browser to run applets on internet. Internet users can use java to create applet programs and run then locally using a “Java- enabled browser” such as Hot Java. They can also use a java-enabled browser to download and applet located on a computer anywhere in the internet and run it on this local computer. In fact, java applets have made the internet a true extension of the storage system of the local computer.
Internet users can also set up their web sites containing java applets that could be used by other remote users of internet. The ability of java applets to hitch a ride on the information super highway has made java a unique programming language for the internet. In fact, due to this, java is popularly known as internet language.
JAVA AND WORLD WIDE WEB:
World Wide Web (WWW) is an open-ended information retrieval system designed to be used in the internet’s distributed environment. This system contains what are known as web pages that provide both information and controls. Unlike a menu-driven system where we are guided through a particular direction using a decision tree structure, the web system is open-ended and we can navigate to a new document in any direction as shown. This is made possible with the help of a language called hypertext markup language (HTML). Web pages contain HTML tags that enable us to find, retrieve, manipulate and display documents worldwide.
Java was meant to be used in distributed environments such as internet. Since, both the web and java share the same philosophy, java could be easily incorporated into the web system before java, the World Wide Web was limited to the display of still images and texts. However, the incorporation of java into web pages has made it capable of supporting animation, graphics, games and a wide range of special effects. With the support of java, the web has become more interactive and dynamic. On the other hand, with the support of web, we can run a java program on someone else’s computer across the internet.
Java communicates with a webpage through a special tag called <APPLET>.
JAVA SUPPORT SYSTEMS:
It is clear from the discussion we had up to now that the operation java and java- enabled browsers on the internet requires a variety of support systems. Lists the systems necessary to support java for delivering information on the internet.
Support System | Description |
Internet Connection | Local computer should be connected to the internet. |
Web Server | A program that accepts requests for information and sends there quired documents. |
Web Browser | A program that provides access to WWW and runs java applets. |
HTML | A language for creating hyper text for the web. |
APPLET Tag | For placing java applet sin HTML document. |
Java Code | Java code is used for defining java applets. |
Byte code | Compiled java code that is referred to into APPLET tag and transferred to the user computer. |
Java Environment:
The developments tools are part of the system known as Java Development Kit(JDK) and the classes and methods are part of the Java Standard Library(JSL), also known as the Application Programming Interface(API).
JDK Contains:
- applet viewer : Enables us to run Java
- java : Java Interpreter (By reading byte code files)
- javac : Java Compiler, convert Java source code to byte code
- javadoc : Creates HTML format document.
- javah : Produces Java header files for use with native
- javap : Java dis assembler, which enables us to convert byte code files in to a program description.
- jdb : Java debugger, which helps us to find errors in our
API Contains:
- Language support package: Collection of classes and
- Utility package: Provide utility functions such as date and time
- Input Output package
- Networking package
- AWT(Abstract Window Toolkit) package
- Applet package
JVM (Java Virtual Machine):
- Java is platform independent language because the Java compiler compiles the code to byte code that is underst and by the Java environment.
- The Java compiler compiles the code to bytecode that is understand by the Java
- The bytecode is the result of compiling a Java program. You can execute this code on any platform. Due to the byte code compilation process and interpretation by a browser, Java programs can be executed on a variety of hardware and operating
- The Java interpreter can execute Java code directly on any machine on which a Java interpreter has been installed.
Java code is portable. There fore, other people can use the programs that you write in Java even if they have different machines with different operating systems.
API (Application Programming Interface)
General Structure of a Java Program
- Documentation Section
- Package Statement
- Import Statement
- Interface Statement & Definition
- Class Definition
- Main Method Class Definition
Add Your Heading Text Here
You May Like to Browers More


