Introduction to Java and Blue-J - #Issue1

java l.png
Image Source

Advent of Java


Sun microsystems funded an internal corporate research project code named Green in 1991. The motivation was the need for a platform independent (platform refers to a combination of hardware and system software) portable language that could be used to create software to be embedded in various consumer electronic devices such as microwave ovens and remote controls.

The project was led by James Gosling and included Patrick Naughton, Chris Warth, Ed frank and Mike Sheridan. It took 18 months to develop the first working version named Oak by James Gosling after an Oak tree outside his window at Sun. It was later discovered that there already was computer language called Oak. When a group of Sun people visited a local coffee place the name Java was suggested and it stuck. World wide web exploded in popularity in 1993.

Web too demanded portable programs. This realization caused the focus of Java to switch from consumer electronics to internet programming. The Internet ultimately led to java's large-scale success. Sun formally announced Java at a major conference in May 1995. Java derives much of its character from C and C+ + but Java is neither an internet version of C+ + nor Java is a superset of C+ +.

History of Java can be put together in the following Java Timeline : Java Time Line


javat1.png
javat2.png
Image Source
An application is a standalone program ( like any other application created in C/C + +) which runs n the computer under the operating system of that computer.Applications run independently of any: - browser.

Byte Code


java's magic is its bytecode. We know that the source code ( a program written in a HLL) is ultimately converted to the executable code ( machine language code) and then executed. This job of converting source code to machine code is done by compiler and interpreter.
Compiler converts the entire program all at once to machine code whereas an interpreter translates it instruction - by - instruction. Most of HLL's are compiled whereas a few like BASIC are interpreted. Machine code is different for different platforms called native executable code. Compilers have to be written for all the different platforms they run on.

Java programs arc special as they are both compiled and interpreted. Java compiler does not produce native executable code, instead it produces a special format called byte code written in hexadecimal. Unlike machine code Java byte code is exactly same on every platform.
The java compiler reads Java source files ( files with extension .java ), translates the source into Java bytecodes, and places the bytecode into class files ( files with extension .class). The compiler generates one class file per class in the source.

To the interpreter (called Java Virtual Machine), a stream of bytecodes is a sequence of instructions. Each bytecode instruction also called opcode is one byte in length.

Byte code is similar to machine code and is produced by,java compiler.


Java programs that have been compiled into byte code still need an interpreter. The interpreter reads the byte code and translates it into native language of the machine. Recently java compilers have been written for some popular platforms which take java byte code and compile them into native machine code.

Java Virtual Machine (JVM)


Java byte code is executed by the Java run-time system, which is called Java Virtual machine (JVM). The Java Virtual Machine, or JVM, is an abstract computer that runs compiled Java programs. The _Wm is "virtual" because it is generally implemented in software on top of a "real" hardware platform and operating system. All Java programs are compiled for the JVM. Therefore, the JVM must be implemented on a particular platform before compiled Java programs will run on that platform.

JVM differs from platform to platform but all interpret the same Java bytecode. Java interpreter running on a system appears and behaves like a virtual processor chip hence the name Java Virtual Machine. The JVM plays a central role in making Java portable. It provides a layer of abstraction between the compiled Java program and the underlying hardware platform and operating system. The JVM. is central to Java's portability because compiled Java programs run on the JVM, independent ofwhatever may be underneath a particular JVM implementation.

Java Environment


Java environment also called Java Platform refers to the Java programming language, along with its runtime interpreter ( Java Virtual Machine ), development tools ( Java Software Development kit) and Application Programming Interfaces ( APIs).

Java Development Toolkit (JDK)


It is a software package from Sun Microsystems which contains the development tools needed to integrate and execute applets and applications. Some tools are : the javac compiler, the java interpreter, the appletviewer etc.

Application Programming Interface (API)


Java provides numerous classes and methods which are part of Java Standard Library USL). JSL is also called AN. The classes, interfaces and methods are grouped into several functional packages. Characteristics of Java ( The Java Buzzwords)

Continued In issue 2



Posted on Utopian.io - Rewarding Open Source Contributors

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now
Logo
Center