Java™ 2 Platform Getting Started.

Slides:



Advertisements
Similar presentations
Introduction To Java Objectives For Today â Introduction To Java â The Java Platform & The (JVM) Java Virtual Machine â Core Java (API) Application Programming.
Advertisements

Introduction to JAVA Vijayan Sugumaran School of Business Administration Oakland University Rochester, MI
Lab Information Security Using Java (Review) Lab#0 Omaima Al-Matrafi.
Introduction to Java The objectives of this chapter are: To describe the key aspects of Java To describe the Java software development kit (SDK) To explain.
Object Orientated Programming
IC211 Object Oriented Programming Overview of Java.
Java: History and Introduction (Lecture # 1). History… Java – Based on C and C++ – Developed in 1991 for intelligent consumer electronic devices – Green.
Introduction to Java Kiyeol Ryu Java Programming Language.
Introduction to Java.
Session-02. Objective In this session you will learn : What is Class Loader ? What is Byte Code Verifier? JIT & JAVA API Features of Java Java Environment.
Lecture 1: Overview of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++ Designed.
01 Introduction to Java Technology. 2 Contents History of Java What is Java? Java Platforms Java Virtual Machine (JVM) Java Development Kit (JDK) Benefits.
Getting Started What is Java? A programming language –Fully buzzword-compliant: A simple, object oriented, distributed, interpreted, robust, secure,
Intro to Java The Java Virtual Machine. What is the JVM  a software emulation of a hypothetical computing machine that runs Java bytecodes (Java compiler.
JAVA v.s. C++ Programming Language Comparison By LI LU SAMMY CHU By LI LU SAMMY CHU.
CSC 142 A 1 CSC 142 Introduction to Java [Reading: chapter 0]
Java Security. Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security Manager.
CSCI 224 Introduction to Java Programming. Course Objectives  Learn the Java programming language: Syntax, Idioms Patterns, Styles  Become comfortable.
Introduction to Java Kumar Harshit. Objectives ( 목적지 ) At the end of the lesson, the student should be able to: ● Describe the features of Java technology.
Java Beserkers Group 4. Start of Java Development began on June of 1991 by a group of computer scientist at the Sun Mircrosystems Company Development.
An intro to programming. The purpose of writing a program is to solve a problem or take advantage of an opportunity Consists of multiple steps:  Understanding.
Java Introduction Lecture 1. Java Powerful, object-oriented language Free SDK and many resources at
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
University of Houston-Clear Lake Proprietary© 1997 Evolution of Programming Languages Basic cycle of improvement –Experience software difficulties –Theory.
1.8History of Java Java –Based on C and C++ –Originally developed in early 1991 for intelligent consumer electronic devices Market did not develop, project.
Introduction and Features of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++
POS 406 Java Technology And Beginning Java Code
Java Introduction 1. Introduction to Java Programming2 Computers and Computer Languages Computers are everywhere –how many computers do you own? Computers.
CPRG 215 Introduction to Object-Oriented Programming with Java Module 1-Introduction to Java Topic 1.1 Basics of Java Produced by Harvey Peters, 2008 Copyright.
What Is Java? According to Sun in a white paper: Java: A simple, object-oriented, network-savvy, interpreted, robust, secure, architecture-neutral, portable,
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
Computer Programming 2 Why do we study Java….. Java is Simple It has none of the following: operator overloading, header files, pre- processor, pointer.
We will talking about story of JAVA language. By Kristsada Songpartom.
Java and its Evolution. Contents Java Introduction Java Features How Java Differs from other OO languages Java and the World Wide Web Java Environment.
Copyright © Mohamed Nuzrath Java Programming :: Syllabus & Chapters :: Prepared & Presented By :: Mohamed Nuzrath [ Major In Programming ] NCC Programme.
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
1. An Introduction A Programming Language A Technology Java Development Kit Java API One Language: Three Editions Standard Edition Enterprise Edition.
Java Basics 1 Brief History of Java and Overview of Langauge.
introductory lecture on java programming
Java – in context Main Features From Sun Microsystems ‘White Paper’
1 Introduction Read D&D Sec 1.8; Sec 1.13 THE Java tutorial -
Java Computer Industry Lab. 1 Programming Java Java Basics Incheon Paik.
ITP 109 Week 2 Trina Gregory Introduction to Java.
Introduction to Programming 1 1 2Introduction to Java.
SESSION 1 Introduction in Java. Objectives Introduce classes and objects Starting with Java Introduce JDK Writing a simple Java program Using comments.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Fundamental of Java Programming (630002) Unit – 1 Introduction to Java.
Chapter 1 Coding Introduction.
Applications Active Web Documents Active Web Documents.
Object Oriented Programming in
Before You Begin Nahla Abuel-ola /WIT.
Done By: Ashlee Lizarraga Ricky Usher Jacinto Roches Eli Gomez
Chapter 1 Introduction to Computers, Programs, and Java
Lecture 1: Introduction to JAVA
Topic: Difference b/w JDK, JRE, JIT, JVM
Internet and Java Foundations, Programming and Practice
What is Java? A programming language Fully buzzword-compliant:
Java programming lecture one
Introduction Enosis Learning.
Chapter 1 FOUNDATIONS OF JAVA
Introduction to Java Dept. Business Computing University of Winnipeg
Introduction Enosis Learning.
Getting Started ARCS Lab..
Introduction CSC 111.
(Computer fundamental Lab)
Java History, Editions, Version Features
Chap 1. Getting Started Objectives
Chap 4. Programming Fundamentals
Computer Programming-1 CSC 111
Outcome of the Lecture Upon completion of this lecture you will be able to understand Fundamentals and Characteristics of Java Language Basic Terminology.
Presentation transcript:

Java™ 2 Platform Getting Started

Background / History Sun Microsystems Inc. 1990, “Green Project” James Gosling 1990, “Green Project” 1991, Develop the Language for Household Products Java James Gosling, Arthur Van Hoff, Andy Bechtolsheim Coffee Materials in Indonesia Write once, Run everywhere Spread Rapidly through WWW and Internet

History of Java Pure Object Oriented Language James Gosling Earlier named Oak later named java

Sun Microsystems Sun (www.sun.com) originally developed Java as a language for television “set top boxes,” which were an instrumental component of the anticipated interactive TV explosion. Instead, the Internet and World Wide Web exploded and Java was quickly drawn into the realm of platform independent computing.

Sun’s philosophy “The Network is the Computer”™ “Write Once, Run anywhere”™. These two concepts are built into every aspect of Java and J2EE.

A Word About the Java Platform The Java platform consists of the Java application programming interfaces (APIs) and the Java virtual machine (JVM).

The Java platform has two components: The Java Virtual Machine The Java Application Programming Interface (API) it's the base for the Java platform and is ported onto various hardware-based platforms.

The Java platform As a platform-independent environment, the Java platform can be a bit slower than native code. However, advances in compiler and virtual machine technologies are bringing performance close to that of native code without threatening portability.

API’s Java APIs are libraries of compiled code that you can use in your programs. They let you add ready-made and customizable functionality to save you programming time. The API is a large collection of ready-made software components that provide many useful capabilities. It is grouped into libraries of related classes and interfaces; these libraries are known as packages.

The Java development environment has two parts: a Java compiler and a Java interpreter.

Java programs are run (or interpreted) by another program called the Java VM. Rather than running directly on the native operating system, the program is interpreted by the Java VM for the native operating system.

This means that any computer system with the Java VM installed can run Java programs regardless of the computer system on which the applications were originally developed.

For example, A Java program developed on a Personal Computer (PC) with the Windows XP operating system should run equally well without modification on a Sun Ultra workstation with the Solaris operating system, and vice versa.

Bytecodes and the Java Virtual Machine Java Development Environment Java Compiler (Pentium) (PowerPC) (SPARC) Java Interpreter Pentium PowerPC SPARC Code ByteCode (Independent on Platform) %javac Hello.java Hello.class created % java Hello JVM Byte Code Run

Java Program Java Application Program Application Applet Program written in general programming language Applet Program running in Web Browser Environment Can be viewed by appletviewer or Web browser with JVM

Java technology is both a programming language and a platform.

The Java Programming Language Simple Architecture neutral Object oriented Portable Distributed High performance Multithreaded Robust Dynamic Secure

Java Features (1) Simple Object oriented fixes some clumsy features of C++ no pointers automatic garbage collection rich pre-defined class library http://java.sun.com/j2se/1.4.2/docs/api/ Object oriented focus on the data (objects) and methods manipulating the data all functions are associated with objects almost all datatypes are objects (files, strings, etc.) potentially better code organization and reuse

Java Features (2) Interpreted Portable java compiler generate byte-codes, not native machine code the compiled byte-codes are platform-independent java bytecodes are translated on the fly to machine readable instructions in runtime (Java Virtual Machine) Portable same application runs on all platforms the sizes of the primitive data types are always the same the libraries define portable interfaces

Java Features (3) Reliable Secure extensive compile-time and runtime error checking no pointers but real arrays. Memory corruptions or unauthorized memory accesses are impossible automatic garbage collection tracks objects usage over time Secure usage in networked environments requires more security memory allocation model is a major defense access restrictions are forced (private, public)

Java Features (4) Multithreaded Dynamic multiple concurrent threads of executions can run simultaneously utilizes a sophisticated set of synchronization primitives (based on monitors and condition variables paradigm) to achieve this Dynamic java is designed to adapt to evolving environment libraries can freely add new methods and instance variables without any effect on their clients interfaces promote flexibility and reusability in code by specifying a set of methods an object can perform, but leaves open how these methods should be implemented can check the class type in runtime

All source code is first written in plain text files ending with the All source code is first written in plain text files ending with the .java extension. Those source files are then compiled into .class files by the javac compiler. A .class file does not contain code that is native to your processor; it instead contains bytecodes — the machine language of the Java Virtual Machine (Java VM). The java launcher tool then runs your application with an instance of the Java Virtual Machine.

The Java Platform A platform is the hardware or software environment in which a program runs. Most popular platforms like Microsoft Windows, Linux, Solaris OS, and Mac OS. Most platforms can be described as a combination of the operating system and underlying hardware. The Java platform differs from most other platforms in that it's a software-only platform that runs on top of other hardware-based platforms.

What Can Java Technology Do? Development Tools Application Programming Interface (API) Deployment Technologies User Interface Toolkits Integration Libraries

Java Technology Change My Life? Get started quickly Write less code Write better code Develop programs more quickly Avoid platform dependencies Write once, run anywhere Distribute software more easily

Object Oriented ? None of the earlier languages provided OO features Modeling real life ? No code reuse Priority to functions. Data was ignored

Major terms Class Object Data Abstraction Data Encapsulation Code Reuse

Java Programming Language? • A development environment • An application environment • A deployment environment • Similar in syntax to C++, similar in semantics to SmallTalk • Used for developing both applets and applications

Primary Goals of Java • Avoiding the pitfalls of other languages • Being object-oriented • Enabling users to create streamlined and clear code

Primary Goals of the Java • Improved speed of development • Code portability • Enables users to run more than one thread of activity • Supports dynamically changing programs during runtime • Furnishes better security

Primary Goals of the Java • The Java virtual machine (JVM) • Garbage collection • Code security

The Java Virtual Machine • Provides hardware platform specifications • Reads compiled byte codes that are platform independent • Is implemented as software or hardware • Is implemented in a Java technology development tool or a Web browser

The Java Virtual Machine • Instruction set (central processing unit [CPU]) • Register set • Class file format • Stack • Garbage-collected heap • Memory area

The Java Virtual Machine • Byte codes that maintain proper type discipline from the code. • The majority of type checking is done when the code is compiled. • Every Sun approved implementation of the JVM must be able to run any compliant class file.

Garbage Collection • Allocated memory that is no longer needed should be deallocated • In other languages, deallocation is the programmer’s responsibility • The Java programming language provides a system level thread to track memory allocation • Checks for and frees memory no longer needed • Is done automatically • Can vary dramatically across JVM implementations

Code Security

Java Runtime Environment • Loads code • Verifies code • Executes code

Class Loader • Loads all classes necessary for the execution of a program • Maintains classes of the local file system in separate"namespaces" • Prevents spoofing

Bytecode Verifier • The code adheres to the JVM specification • The code does not violate system integrity • The code causes no operand stack overflows or underflows • The parameter types for all operational code are correct • No illegal data conversions (the conversion of integers to pointers) have occurred

A Basic Java Application HelloWorldApp.java 1 // 2 // Sample HelloWorld application 3 // 4 public class HelloWorldApp{ 5 public static void main (String args[]) { 6 System.out.println("Hello World!"); 7 } 8 }

Compiling and Running HelloWorld • Compiling HelloWorld.java javac HelloWorld.java • Running an application java HelloWorld • Locating common compile and runtime errors

Features Security Platform Independence, Write Once Run EverywhereTM High performance Simplicity