Title: Java: History and Introduction
1Java History and Introduction
2History
- Java
- Based on C and C
- Developed in 1991 for intelligent consumer
electronic devices - Green Project (According to Gosling, "the goal
was ... to build a system that would let us do a
large, distributed, heterogeneous network of
consumer electronic devices all talking to each
other." ) - James Gosling Modified C
- Named Oak then Java
3History
- Platform independent ("Write Once, Run Anywhere")
- Interpreted Language
- Intermediate Code (Byte Code)
- Reliable
- Multiple inheritance and Operator overloading
removed - No Pointers because of security reasons
4History
- Internet exploded in 1993, saved project
- Reliability
- Security
- Platform Independence
- Java formally announced in 1995
- Now used to create web pages with interactive
content and applications for consumer devices
(pagers, cell phones)...
5Why Java??
6Motivation ?
- Simple
- Pure Object Oriented Language
- Allows Multi-threading
- Automatic Garbage Collection
- More Robust (Run time exceptions)
- (Anyone heard of smart cards?)
7Disadvantages ?
- SpeedSlower than C
- To the rescue
- Just-in-time (JIT) compilation
- Inability to access platform-specific code
- To the rescue
- Java Native Interface (JNI) (can also speed up
code)
8Difference Between C and Java
- Java is C minus
- Pointers
- Destructors
- Structs and unions
- Templates
- Multiple Inheritance
- Operator Overloading
9Types Of Java Programs
- Applications Stand-alone java programs runnable
from command prompt - Applets Run from inside a web browser or the
appletviewer
10Basics of a Typical Java Environment
- Java Systems
- Consist of environment, language, Java
Applications Programming Interface (API) - Java programs have five phases
- 1. Edit
- .java extension
- 2. Compile
- javac command javac MyProgram.java
- Creates .class file containing bytecodes
11Basics of a Typical Java Environment
- 3. Loading
- Class loader transfers .class file into memory
- Classes loaded and executed by interpreter with
java command - To load,
- appletviewer Welcome.html
- Or java MyFile
12Basics of a Typical Java Environment
- 4. Verify
- Bytecode verifier makes sure bytecodes are valid
and do not violate security - 5. Execute
- Computer interprets program one bytecode at a
time - Performs actions specified in program
13Program is created in the editor and stored on
disk.
Phase 1
Compiler creates bytecodes and stores them on
disk.
Phase 2
Primary Memory
Phase 3
Class loader puts bytecodes in memory.
Disk
Primary Memory
Phase 4
Bytecode verifier confirms that all bytecodes
are valid and do not violate Javas security
restrictions.
Primary Memory
Interpreter reads bytecodes and translates them
into machine language for that computer.
Phase 5
14Java Virtual Machine (JVM)
- Hypothetical computer that executes a Java
program the interpreter - Each computer architecture (Intel x86, Macintosh,
etc.) has its own JVM implemented in software - Sun Microsystems also has a JVM processor
(hardware chip) - Web browsers have built-in interpreter
15Intro to Some Java Technologies
- Servlets Small server-side programs
- JDBC Links Java programs to databases
- RMI Helps build distributed applications
- EJBs Reusable software components
16Thank you!!