Chapter 1 The Origin of java
Java's Lineage :
java is related to c++, which is a direct descendent of c. Much of the chapter of java is inherited from these two languages. From c, java derives its syntax. Many of java's object oriented features were influenced by c++.
The creating of java:
java was conceived by James Gosling, Patrik Naughton, Chris Warth , Ed Frank and Mike Sheridan at Sun Microsystems, inc. 1991. It took 18 month to develop the first working version. This language was initially called "Oak", but was renamed "java" in 1995.
Why java is important to the internet :
The reason for this is quite simple java expands the universe of objects that can move about freely in cyberspace. In a network, there are two very board categories of objects that are transmitted between the server and your personal computer passive information and dynamic, active programs.
Java Applets and Application :
java can be used to create two types of programs application and applet.
1.Aplication :An application created by java is more or less like one created using c or c++.
2.Applet :An applet is an application designed to be transmitted over the internet and executed by a java-compatible web browser.
Security :
When you use java compatible web browser, it is possible to safely download java applets without fear of viral infection or malicious intent.
Portability :
As discussed earlier, there are many types of computers and operating systems in use throughout the world - and many are connected to the internet. For programs to be dynamically downloaded to all of the various types of platforms connected to the internet, some means of generating portable executable code is needed.
Java Magic the" Byte codes ":
Usually a computer language is either compiled or interpreted. Java combines both these approaches thus making java two-stage system. First, java compiler translate source code into what is known as byte code instruction. Byte code are not machine instructions and there fore, in the second stage , java interpreter generates machine code that can be directly executed by the machine that is running the java program.
javac |
| --> |
| ||
compiler | |||||
java |
| ||||
interpreter |
Object - Oriented :
java is a true object-oriented language. Almost everything in java is an object. All program code and data reside with in objects and classes. java come with an extensive set of classes arranged in package, that we can use in our programs by inheritance.
Difference between c++ and java :
c++ | java |
c++ supports operator overloading. | java does not support operator overloading. |
c++ supports multiple inheritance of classes. | java does not support multiple inheritance of class (This is accomplished using a new feature called "interface"). |
c++ supports global variables. | java does not supports global variables. |
c++ supports pointer. | java does not use pointer. |
There are header file in c++. | There are no header files in java. |
Difference between c and java :
c | java |
There are keywords like goto, sizeof, typedef. | java does not include the keywords like goto sizeof,typedef. |
c contains struct union and enum data types. | java does not contain struct, union, enum data types. |
c supports pointer. | java does not support pointer. |
c have pre processor like #define, #include, and #ifdef. | java does not have preprocessor. |
c is not object - oriented language. | java is an object oriented language. |