Java
Background
Features
Platform Independence
History
 "Java, whose original name was Oak, was developed as a part of
the Green project at Sun. It was started in December '90 by Patrick
Naughton, Mike Sheridan and James Gosling and was chartered to
spend time trying to figure out what would be the "next wave" of
computing and how we might catch it. They came to the conclusion
that at least one of the waves was going to be the convergence of
digitally controlled consumer devices and computers. "
 Applets and Applications
 "The team returned to work up a Java technology-based clone of
Mosaic they named "WebRunner" (after the movie Blade Runner),
later to become officially known as the HotJavaTM browser. It was
1994. WebRunner was just a demo, but an impressive one: It
brought to life, for the first time, animated, moving objects and
dynamic executable content inside a Web browser. That had never
been done. [At the TED conference.]"
What is Java
 Java - The new programming language from Sun Microsystems
 Java -Allows anyone to publish a web page with Java code in it
 Java - CPU Independent language
 Created for consumer electronics
 Java - James , Arthur Van , and others
What is Java
It is an object-oriented language developed by Sun in the mid 1990s.
Original language called Oak
Intended for embedded systems
• Unlike C++, it was developed from scratch.
The syntax is very similar to C.
Sun describes it as
"A simple, object-oriented, distributed, interpreted, robust, secure,
architecture neutral, portable, high-performance, multi-threaded
and dynamic language."
Object-Oriented
Designed to support Object-Oriented concepts
Distributed
Applications are constructed using objects. Objects can be
distributed in multiple locations within a network
environment.
Extensive integration with TCP/IP
Interpreted
Java compiles to byte-code (not machine code). Byte code
is interpreted.
Most Java versions after 1.2 include a JIT (Just-In-Time)
compiler which compiles byte code to machine code.
Robust
Memory management is done automatically
Use of pointers is limited
Secure
All Java code subject to security model.
Architecture-Neutral/Portable
Compiled Java (byte code) will run on any platform which
has a Java Virtual Machine
The Java Virtual Machine is available for almost all
platforms...
Even mainframes.
High-Performance
Originally, Java's performance was poor.
Now, Java's performance rivals C++.
Multi-Threaded
Processes contain multiple threads of execution.
Similar to multi-tasking but all threads share the same
memory space.
Dynamic
Makes heavy use of dynamic memory allocation.
Classes can be dynamically loaded at any time.
For World Java is :
 Snazzy Web pages
 The cross-platform language we want
 The C++ replacement we need
 The C++ replacement we dont need
 A bunch of hype
For SUN Java is:
 Simple and Powerful
 Object Oriented
 Portable
 Architecture Neutral
 Distributed
 Multi-threaded
 Robust, Secure/Safe
 Interpreted
 High Performance
 Dynamic pogramming language/platform.
For Us Java is :
 Simple
 Pure
 Portable
 Surprisingly effective
 Need of Today!!!!
Platform Independence
Platform ?
Independence????????
Java has been described as WORA (Write once, Run Anywhere)
In most cases, this is true.
Not always true with GUI.
Doesn't always come for free. Can require a lot of testing.
Platform Independence….
Traditional view :
Source.cpp
i386 binary
SPARC binary
PPC binary
Windows
Compiler
Solaris
Compiler
Mac
Compiler
JVM(Java Virtual Machine)
Java source files (.java) are compiled to Java bytecode (.class)
Bytecode is interpreted on the target platform within a Java Virtual
Machine
Source.java
i386 VM
SPARC VM
PPC VM
Java
Compiler
Java
Bytecode
Source.class
Why Virtual
JVM
 JVM is sometimes referred to as interpreter which takes the
byte code from Java Compiler (.Class) and generates the
object code for the target machine.
 The output of Java Compiler is not for a particular existing
machine, it is generated for JVM which is actually not a
machine therefore it is called Virtual Machine though it is a
translator/interpreter which converts one code (byte code) to
another code(machine code)
Independence
Because Java source code is compiled to byte code and the
byte code is interpreted, Java code can be executed anywhere
an interpreter is available.
The "Interpreter" is call the Java Virtual Machine
JVM
The Java VM does more than interpret bytecode:
The class loader loads appropriate java classes. Possibly
from the network.
All classes are verified to contain only legal bytecodes and
not permitted any illegal stack or register usage.
A SecurityManager can limit access to resources such as the
local file system or the network.
Any unreferenced memory (Objects) are returned to the
system by the Garbage Collector thread.
• Many database servers, application servers, web servers and
browsers contain a Java virtual machine
• eg: Oracle, Tomcat (web server), WebSphere (app server),
BEA Weblogic (app server), and Netscape and IE.
Java Integrates
Power of Compiled Languages
and
Flexibility of Interpreted
Languages

Java Class1

  • 1.
  • 2.
    History  "Java, whoseoriginal name was Oak, was developed as a part of the Green project at Sun. It was started in December '90 by Patrick Naughton, Mike Sheridan and James Gosling and was chartered to spend time trying to figure out what would be the "next wave" of computing and how we might catch it. They came to the conclusion that at least one of the waves was going to be the convergence of digitally controlled consumer devices and computers. "  Applets and Applications  "The team returned to work up a Java technology-based clone of Mosaic they named "WebRunner" (after the movie Blade Runner), later to become officially known as the HotJavaTM browser. It was 1994. WebRunner was just a demo, but an impressive one: It brought to life, for the first time, animated, moving objects and dynamic executable content inside a Web browser. That had never been done. [At the TED conference.]"
  • 3.
    What is Java Java - The new programming language from Sun Microsystems  Java -Allows anyone to publish a web page with Java code in it  Java - CPU Independent language  Created for consumer electronics  Java - James , Arthur Van , and others
  • 4.
    What is Java Itis an object-oriented language developed by Sun in the mid 1990s. Original language called Oak Intended for embedded systems • Unlike C++, it was developed from scratch. The syntax is very similar to C. Sun describes it as "A simple, object-oriented, distributed, interpreted, robust, secure, architecture neutral, portable, high-performance, multi-threaded and dynamic language."
  • 5.
    Object-Oriented Designed to supportObject-Oriented concepts Distributed Applications are constructed using objects. Objects can be distributed in multiple locations within a network environment. Extensive integration with TCP/IP Interpreted Java compiles to byte-code (not machine code). Byte code is interpreted. Most Java versions after 1.2 include a JIT (Just-In-Time) compiler which compiles byte code to machine code.
  • 6.
    Robust Memory management isdone automatically Use of pointers is limited Secure All Java code subject to security model. Architecture-Neutral/Portable Compiled Java (byte code) will run on any platform which has a Java Virtual Machine The Java Virtual Machine is available for almost all platforms... Even mainframes.
  • 7.
    High-Performance Originally, Java's performancewas poor. Now, Java's performance rivals C++. Multi-Threaded Processes contain multiple threads of execution. Similar to multi-tasking but all threads share the same memory space. Dynamic Makes heavy use of dynamic memory allocation. Classes can be dynamically loaded at any time.
  • 8.
    For World Javais :  Snazzy Web pages  The cross-platform language we want  The C++ replacement we need  The C++ replacement we dont need  A bunch of hype
  • 9.
    For SUN Javais:  Simple and Powerful  Object Oriented  Portable  Architecture Neutral  Distributed  Multi-threaded  Robust, Secure/Safe  Interpreted  High Performance  Dynamic pogramming language/platform.
  • 10.
    For Us Javais :  Simple  Pure  Portable  Surprisingly effective  Need of Today!!!!
  • 11.
    Platform Independence Platform ? Independence???????? Javahas been described as WORA (Write once, Run Anywhere) In most cases, this is true. Not always true with GUI. Doesn't always come for free. Can require a lot of testing.
  • 12.
    Platform Independence…. Traditional view: Source.cpp i386 binary SPARC binary PPC binary Windows Compiler Solaris Compiler Mac Compiler
  • 13.
    JVM(Java Virtual Machine) Javasource files (.java) are compiled to Java bytecode (.class) Bytecode is interpreted on the target platform within a Java Virtual Machine Source.java i386 VM SPARC VM PPC VM Java Compiler Java Bytecode Source.class
  • 14.
  • 15.
    JVM  JVM issometimes referred to as interpreter which takes the byte code from Java Compiler (.Class) and generates the object code for the target machine.  The output of Java Compiler is not for a particular existing machine, it is generated for JVM which is actually not a machine therefore it is called Virtual Machine though it is a translator/interpreter which converts one code (byte code) to another code(machine code)
  • 16.
    Independence Because Java sourcecode is compiled to byte code and the byte code is interpreted, Java code can be executed anywhere an interpreter is available. The "Interpreter" is call the Java Virtual Machine
  • 18.
    JVM The Java VMdoes more than interpret bytecode: The class loader loads appropriate java classes. Possibly from the network. All classes are verified to contain only legal bytecodes and not permitted any illegal stack or register usage. A SecurityManager can limit access to resources such as the local file system or the network. Any unreferenced memory (Objects) are returned to the system by the Garbage Collector thread. • Many database servers, application servers, web servers and browsers contain a Java virtual machine • eg: Oracle, Tomcat (web server), WebSphere (app server), BEA Weblogic (app server), and Netscape and IE.
  • 19.
    Java Integrates Power ofCompiled Languages and Flexibility of Interpreted Languages