A Little More Java Java 1st cup - PowerPoint PPT Presentation

1 / 20
About This Presentation
Title:

A Little More Java Java 1st cup

Description:

You can use Java to write computer applications that. crunch numbers ... DEC Alphas running Windows NT would be another. 9/20/09. Java Fundamentals. Page 17 ... – PowerPoint PPT presentation

Number of Views:125
Avg rating:3.0/5.0
Slides: 21
Provided by: walterma
Category:
Tags: 1st | alphas | cup | java | more

less

Transcript and Presenter's Notes

Title: A Little More Java Java 1st cup


1
A Little More JavaJava -- 1st cup
  • Based on lectures by Walter Makovoz, Ph.D.

2
Java is a language which is
  • simple
  • object-oriented
  • distributed
  • interpreted
  • robust
  • secure
  • architecture neutral
  • portable
  • high-performance
  • multithreaded
  • dynamic

3
Java is ...
  • ... high-level
  • third generation programming
  • language( like C, Fortran, Smalltalk, Perl, etc.)
  • You can use Java to write computer applications
    that
  • crunch numbers
  • process words
  • play games

4
Java is distributed
  • Java developer can create a class that is
    dependent on a class that resides on the Net,
    thus being assured of always picking up the
    latest copy of the remote class.
  • The Net functionality makes Java a truly
    distributed environment.

5
Java is interpreted
  • Java uses an interpreted environment as its
    solution to the problem of functioning in a
    multi-platform environment.
  • The Java compiler reads source files and from
    those files produces bytecode.

6
Java is robust
  • Java promotes the development of software robust
    enough to run in a multi-platform environment
  • Takes over memory management responsibilities
  • Eliminates pointers
  • Makes arrays into true objects
  • Tightens up type-checking
  • Links dynamically

7
Java is secure
  • Java features assure system administrator that
    the Java environment is secure, and they can go
    ahead and install it on the their systems.

8
Java is architecture-neutral
  • No matter where you are located on the continuum
    of software development and use, Javas
    architecture-neutral interpreted bytecodes are a
    boon.

9
Java is portable
  • implementation according to the interpreter
  • standardized data types
  • windowing

10
Java is multithreaded
  • In the Java system, multiple processes (known as
    threads) execute simultaneously with Java itself
    apportioning system resources to each of the
    these threads.
  • Java was written to take advantage of the
    pre-emptive, multithreaded capabilities of the
    modern operating systems on which its been
    implemented.

11
Java is dynamic
  • Java linking practices, combined with its
    flexible but strict class usage, make it dynamic
    enough to function reliably in an evolving
    environment.

12
Java Tools
  • Appletviewer
  • Runs applets on your machine outside the context
    of a Web browser
  • Java
  • Java interpreted interprets and executes
    bytecodes
  • Javac
  • Java compiler compiles source files into
    bytecodes
  • Javadoc
  • Generates API documentation from Java source
    files
  • Javah
  • Generates C-language header and source files to
    connect Java programs with native compiled C code
  • Javap
  • Disassembles compiled byte code into its
    component variables and methods
  • Jdb
  • Java debugger an interactive debugger

13
Java Terminology
  • Java Applications
  • Standalone Java programs that do not require a
    Web browser to run
  • Java applications are more general-purpose
    programs like those you would find on any
    computer.
  • Java Applets
  • They run and are displayed inside a Web page with
    other page elements, and therefore have special
    rules for how they behave.
  • Because of these special rules for applets,
    creating an applet may in many cases be more
    complex than creating an application.
  • Java Bytecodes
  • Special set of machine instructions that are not
    specific to any one processor or computer system
  • The byte code interpreter is also called the Java
    virtual machine or the Java runtime interpreter.

14
Java
  • Java lets you write special programs called
    applets that can be downloaded from the Internet
    and run safely within a web browser.
  • Traditional computer programs have far too much
    access to your system to be downloaded and
    executed willy-nilly.

15
Java Features
  • Java solves security problem by severely
    restricting what an applet can do
  • A Java applet cannot write to your hard disk
    without your permission.
  • It cannot write to arbitrary addresses in memory
    and thereby introduce a virus into your computer.
  • It should not crash your system.

16
Java is a Platform
  • Java (with a capital J) is a platform for
    application development.
  • A platform is a loosely defined computer industry
    buzzword that typically means some combination of
    hardware and system software that will mostly run
    all the same software.
  • For instance PowerMacs running System 7.5 would
    be one platform.
  • DEC Alphas running Windows NT would be another.

17
Java is a Platform
  • Computer programs are closely tied to the
    specific hardware and operating system.
  • Eg., Windows program will not run on a computer
    that only runs DOS.
  • A Mac application can't run on a Unix
    workstation.
  • Major commercial applications like Microsoft Word
    or Netscape have to be written almost
    independently for all the different platforms
    they run on.

18
Java is a Platform
  • Java solves the problem of platform-independence
    by using byte code.
  • The Java compiler does not produce native
    executable code for a particular machine like a C
    compiler would.
  • Instead it produces a special format called byte
    code.
  • Java byte code written in hexadecimal, byte by
    byte, looks like this
  • CA FE BA BE 00 03 00 2D 00 3E 08 00 3B 08 00 01
    08 00 20 08
  • This looks a lot like machine language, but
    unlike machine language Java byte code is exactly
    the same on every platform.

19
Java is a Platform
  • This byte code fragment means the same thing on a
    Solaris workstation as it does on a Macintosh
    PowerBook.
  • Java programs that have been compiled into byte
    code still need an interpreter to execute them on
    any given platform.
  • The interpreter reads the byte code and
    translates it into the native language of the
    host machine.
  • Since the byte code is completely platform
    independent, only the interpreter and a few
    native libraries need to be ported to get Java to
    run on a new computer or operating system.
  • The rest of the runtime environment including the
    compiler and most of the class libraries are
    written in Java.

20
Java
  • All these pieces, the javac compiler, the java
    interpreter, the Java programming language, and
    more are collectively referred to as Java. .
Write a Comment
User Comments (0)
About PowerShow.com