JEDI Slides Intro1 Chapter02 Introduction to Java

Embed Size (px)

Citation preview

  • 8/4/2019 JEDI Slides Intro1 Chapter02 Introduction to Java

    1/12

    Introduction to Programming 1 1

    2 Introduction to Java

  • 8/4/2019 JEDI Slides Intro1 Chapter02 Introduction to Java

    2/12

    Introduction to Programming 1 2

    Topics

    Java Background

    A little Bit of History

    What is Java Technology?

    Phases of a Java Program

  • 8/4/2019 JEDI Slides Intro1 Chapter02 Introduction to Java

    3/12

    Introduction to Programming 1 3

    Java Background: History Java

    was created in 1991

    by James Gosling et al. of Sun Microsystems.

    Initially called Oak, in honor of the tree outside Gosling's window, its name

    was changed to Java because there was already a language called Oak.

  • 8/4/2019 JEDI Slides Intro1 Chapter02 Introduction to Java

    4/12

    Introduction to Programming 1 4

    Java Background: History Java

    The original motivation for Java: the need for platform independentlanguage that could be embedded in various consumer electronic productslike toasters and refrigerators.

    One of the first projects developed using Java: a personal hand-heldremote control named Star 7.

    At about the same time, the World Wide Web and the Internet were gainingpopularity. Gosling et. al. realized that Java could be used for Internetprogramming.

  • 8/4/2019 JEDI Slides Intro1 Chapter02 Introduction to Java

    5/12

    Introduction to Programming 1 5

    Java Background:

    What is Java Technology? The Java technology is:

    A programming language

    A development environment

    An application environment

    A deployment environment

  • 8/4/2019 JEDI Slides Intro1 Chapter02 Introduction to Java

    6/12

    Introduction to Programming 1 6

    Java Technology:

    Programming Language As a programming language, Java can create all kinds of

    applications that you could create using any conventionalprogramming language.

  • 8/4/2019 JEDI Slides Intro1 Chapter02 Introduction to Java

    7/12

    Introduction to Programming 1 7

    Java Technology:

    A Development Environment As a development environment, Java technology provides

    you with a large suite of tools:

    A compiler

    An interpreter A documentation generator

    A class file packaging tooland so on...

  • 8/4/2019 JEDI Slides Intro1 Chapter02 Introduction to Java

    8/12

    Introduction to Programming 1 8

    Java Technology:An Application and Runtime Environment

    Java technology applications are typically general-purposeprograms that run on any machine where the Java runtimeenvironment (JRE) is installed.

    There are two main deployment environments:

    1. The JRE supplied by the Java 2 Software Development Kit (SDK)contains the complete set of class files for all the Java technologypackages, which includes basic language classes, GUI component

    classes, and so on.2. The other main deployment environment is on your web browser.

    Most commercial browsers supply a Java technology interpreter andruntime environment.

  • 8/4/2019 JEDI Slides Intro1 Chapter02 Introduction to Java

    9/12

    Introduction to Programming 1 9

    Phases of a Java Program

    The following figure describes the process of compiling andexecuting a Java program

  • 8/4/2019 JEDI Slides Intro1 Chapter02 Introduction to Java

    10/12

    Introduction to Programming 1 10

    Phases of a Java Program

    Definitions:

    Bytecode

    a special machine language that can be understood by the Java Virtual Machine(JVM).

    is independent of any particular computer hardware, so any computer with a Javainterpreter can execute the compiled Java program, no matter what type ofcomputer the program was compiled on.

    The Java Virtual Machine

    is an imaginary machine that is implemented by emulating software on a real

    machine. provides the hardware platform specifications to which you compile all Java

    technology code.

    This specification enables the Java software to be platform-independent becausethe compilation is done for a generic machine known as the JVM.

  • 8/4/2019 JEDI Slides Intro1 Chapter02 Introduction to Java

    11/12

    Introduction to Programming 1 11

    Phases of a Java Program

  • 8/4/2019 JEDI Slides Intro1 Chapter02 Introduction to Java

    12/12

    Introduction to Programming 1 12

    Summary

    Java Background

    History

    Java Technology

    A programming language A development environment

    An application environment

    A deployment environment

    Phases of a Java Program

    Write, compile, run

    Defined:

    Bytecodes

    Java Virtual Machine (JVM)