Introduction

1.What is Java?

Java is an object-oriented programming language developed initially by James Gosling and colleagues at Sun Microsystems. The language, initially called Oak (named after the oak trees outside Gosling's office), was intended to replace C++, although the feature set better resembles that of Objective C. Java should not be confused with JavaScript, which shares only the name and a similar C-like syntax. Sun Microsystems currently maintains and updates Java regularly.

Source: en.wikipedia.org/wiki/Java_(language)

A multi-platform, object-oriented programming language from Sun Microsystems. The Java language syntax is somewhat similar to C. Java can be used to program applications and applets.

2.Java Virtual Machine

Java Virtual Machine - Also called a "Java Interpreter", "Java Runtime" - Converts byte code into OS specific commands. In addition to governing the execution of an application's byte codes, the virtual machine handles related tasks such as managing the system's memory, providing security against malicious code, and managing multiple threads of program execution.


www.utstar.com/Glossary/G-K/

Java Virtual Machine (JVM) originally developed by Sun Microsystems, is a virtual machine that executes Java byte code. This code is most often generated by Java language compilers, although the JVM has also been targeted by compilers of other languages.

The JVM is a crucial component of the Java platform. The availability of JVMs on many types of hardware and software platforms enables Java to function both as middleware and a platform in its own right. Hence the expression "Write once, run anywhere."

The Java Virtual Machine is the cornerstone of the Java programming language. It is the component of the Java technology responsible for cross platform delivery. The JVM is an abstract computing machine and (just like a real computing machine) has a defined instruction set.

The JVM knows nothing of the Java language, only of a particular file format, the class file format. A class file contains JVM instructions (or byte codes) and a symbol table, as well as other required information

3. Compiler

A compiler is a computer program that translates a computer program written in one computer language (called the source language) into an equivalent program written in another computer language (called the output, object, or target language).
A compiler is a special program that processes statements written in a particular programming language and turns them into machine language or "code" that a computer's processor uses

Compiler provides runtime compilation of Java byte code, thereby speeding Java performance

A compiler is a special program that processes statements written in a particular programming language and turns them into machine language or "code" that a computer's processor uses. Typically, a programmer writes language statements in a language such as  or  one line at a time using an editor. The file that is created contains what are called the source statements. The programmer then runs the appropriate language compiler, specifying the name of the file that contains the source statements.

When executing (running), the compiler first parses (or analyzes) all of the language statements syntactically one after the other and then, in one or more successive stages or "passes", builds the output code, making sure that statements that refer to other statements are referred to correctly in the final code.

Traditionally, the output of the compilation has been called object code or sometimes an object module. (Note that the term "object" here is not related to .) The object code is  that the processor can process or "execute" one instruction at a time

More recently, the Java programming language, a language used in object-oriented programming, has introduced the possibility of compiling output (called byte code) that can run on any computer system platform for which a Java  or byte code interpreter is provided to convert the byte code into instructions that can be executed by the actual hardware processor. Using this virtual machine, the byte code can optionally be recompiled at the execution platform by a .

Java and JavaScript

Java is an Object Oriented Programming (OOP) language created by James Gosling of Sun Microsystems. JavaScript was created by the fine people at Netscape. JavaScript is a distant cousin of Java. It is also an OOP language. Many of their  structures are similar. However, JavaScript contains a much smaller and simpler set of commands than does Java. It is easier for the average weekend warrior to understand.

You may be wondering what OOP means by now.  Programming is a relatively new concept, whereas the sum of the parts of a  make up the whole. Think of it this way: you are building a model car. You build the engine first. It can stand alone. It is an engine and everyone can see it's an engine. Next you build the body. It can also stand alone.

Finally, you build the interior including the seats, steering wheel, and whatnot. Each, by itself is an object. But it is not a fully functioning car until all the pieces are put together. The sum of the objects (parts) make up the whole.

The main difference is that Java can stand on its own while JavaScript must be placed inside an  document to function. Java is a much larger and more complicated language that creates "standalone" applications. A Java "applet" (so-called because it is a little application) is a fully contained program. JavaScript is text that is fed into a browser that can read it and then is enacted by the browser.

Another major difference is how the language is presented to the end user (that's you when you're surfing). Java must be compiled into what is known as a "machine language" before it can be run on the Web. Basically what happens is after the programmer writes the Java program and checks it for errors, he or she hands the text over to another computer program that changes the text code into a smaller language. That smaller language is formatted so that it is seen by the computer as a set program with definite beginning and ending points. Nothing can be added to it and nothing can be subtracted without destroying the program.

JavaScript is text-based. You write it to an HTML document and it is run through a browser. You can alter it after it runs and run it again and again. Once the Java is compiled, it is set. Sure, you can go back to the original text and alter it, but then you need to compile again.

Java applets run independent of the HTML document that is calling for them. Sure, they appear on the page, but the HTML document did little more than call for the application and place it. If the programmer allows it, oftentimes parameters can be set by the HTML document. This includes the background colour of the applet of the type of text it displays, etc. The delivery of the applet is done through a download. The HTML document calls for the application, it downloads to the user's cache, and waits to run. JavaScript is wholly reliant on the browser to understand it and make it come to life.

Object oriented programming

Object-oriented programming, OOP for short, is a computer .

The idea behind object-oriented programming is that a computer program may be seen as comprising a collection of individual units, or objects, that act on each other, as opposed to a traditional view in which a program may be seen as a collection of , or simply as a list of  to the computer. Each object is capable of receiving , processing data, and sending messages to other objects. Each object can be viewed as an independent little machine or actor with a distinct role or responsibility.

Object-oriented programming is claimed to promote greater flexibility and  in programming, and is widely popular in large-scale .

Furthermore, proponents of OOP claim that OOP is easier to learn for those new to  than previous approaches, and that the OOP approach is often simpler to develop and to maintain, lending itself to more direct analysis, coding, and understanding of complex situations and procedures than other programming methods. Critics dispute this, at least for some domains (industries).

Object-oriented programming (OOP) emphasizes the following concepts:

Join now!

Class:  the unit of definition of data and behaviour (functionality) for some kind-of-thing. For example, the 'class of Dogs' might be a  which includes the various breeds of dogs. A class is the basis of  and  in an object-oriented computer program. A class should typically be recognizable to a non-programmer familiar with the problem domain, and the code for a class should be (relatively) self-contained and independent (as should the code for any good pre-OOP ). With such modularity, the structure of a program will correspond to the  of the  that the program is intended to solve. This simplifies the ...

This is a preview of the whole essay