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.

Slides:



Advertisements
Similar presentations
1 Copyright © 2005, Oracle. All rights reserved. Introducing the Java and Oracle Platforms.
Advertisements

Introduction To Java Objectives For Today â Introduction To Java â The Java Platform & The (JVM) Java Virtual Machine â Core Java (API) Application Programming.
Java security (in a nutshell)
CSCE 145: Algorithmic Design I Chapter 1 Intro to Computers and Java Muhammad Nazmus Sakib.
Lab Information Security Using Java (Review) Lab#0 Omaima Al-Matrafi.
Lab#1 (14/3/1431h) Introduction To java programming cs425
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.
got ? Research Project – April 1998 Hang Xia, Mark Wang, Richard S. Chang Updated: R Norman, August 1999.
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.
Java for High Performance Computing Jordi Garcia Almiñana 14 de Octubre de 1998 de la era post-internet.
JVM-1 Introduction to Java Virtual Machine. JVM-2 Outline Java Language, Java Virtual Machine and Java Platform Organization of Java Virtual Machine Garbage.
For more Lectures and Notes Visit
CS884 (Prasad)Java Goals1 “Perfect Quote” You know you've achieved perfection in design, Not when you have nothing more to add, But when you have nothing.
Introduction to Java.
L EC. 01: J AVA FUNDAMENTALS Fall Java Programming.
01 Introduction to Java Technology. 2 Contents History of Java What is Java? Java Platforms Java Virtual Machine (JVM) Java Development Kit (JDK) Benefits.
Java program.
Java program. Java Tutorial Java technology is widely used currently. Let's start learning of java from basic questions like what is java, where it is.
A Java Virtual Machine (JVM) enables a set of computer software programs and data structures to use a virtual machine model for the execution of other.
Embedded Java Research Geoffrey Beers Peter Jantz December 18, 2001.
Java Introduction 劉登榮 Deng-Rung Liu 87/7/15. Outline 4 History 4 Why Java? 4 Java Concept 4 Java in Real World 4 Language Overview 4 Java Performance!?
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]
CSCI 224 Introduction to Java Programming. Course Objectives  Learn the Java programming language: Syntax, Idioms Patterns, Styles  Become comfortable.
Java Virtual Machine Java Virtual Machine A Java Virtual Machine (JVM) is a set of computer software programs and data structures that use.
Java Introduction Lecture 1. Java Powerful, object-oriented language Free SDK and many resources at
Why Java? A brief introduction to Java and its features Prepared by Mithat Konar.
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
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.
JAVA Java is a programming language and computing platform first released by Sun Microsystems in It was first developed by James Gosling at Sun Microsystems,
Introduction and Features of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++
Java 2 security model Valentina Casola. Components of Java the development environment –development lifecycle –Java language features –class files and.
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,
Chapter 2: A Brief History Object- Oriented Programming Presentation slides for Object-Oriented Programming by Yahya Garout KFUPM Information & Computer.
Computer Programming 2 Why do we study Java….. Java is Simple It has none of the following: operator overloading, header files, pre- processor, pointer.
CT1513 Introduction To java © A.AlOsaimi.
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: An Overview John R Durrett Texas Tech University.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
By: Cheryl Mok & Sarah Tan. Java is partially interpreted. 1. Programmer writes a program in textual form 2. Runs the compiler, which converts the textual.
introductory lecture on java programming
Java – in context Main Features From Sun Microsystems ‘White Paper’
Introduction to Programming 1 1 2Introduction to Java.
20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 15: Java Basics Fundamentals of Web Programming.
Introduction to JAVA Programming
JAVA TRAINING IN NOIDA. Introduction to Java:  Java training in noida is a general-purpose computer programming language that is concurrent, class-based,
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Fundamental of Java Programming (630002) Unit – 1 Introduction to Java.
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
Java security (in a nutshell)
Java programming lecture one
Introduction Enosis Learning.
Chapter 1 FOUNDATIONS OF JAVA
Introduction Enosis Learning.
(Computer fundamental Lab)
Java History, Editions, Version Features
M S COLLEGE ART’S, COMM., SCI. & BMS
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:

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 Setup How to set path in Java What is Life Cycle of Java?

What is Class Loader ? Classloader is a subsystem of JVM that is used to load class files at runtime. A class loader is an object that is responsible for loading classes. The ClassLoader is an abstract class. Given the binary name of a class A typical strategy is to transform the name into a file name and then read a "class file" of that name from a file system.

Continue... ClassLoader in Java works on three principle: delegation, visibility and uniqueness. Delegation Delegation principle forward request of class loading to parent class loader and only loads the class, if parent is not able to find or load class. Visibility Visibility principle allows child class loader to see all the classes loaded by parent ClassLoader, but parent class loader can not see classes loaded by child. Uniqueness Uniqueness principle allows to load a class exactly once, which is basically achieved by delegation and ensures that child ClassLoader doesn't reload the class already loaded by parent.

Example

How to load class explicitly in Java? Java provides API to explicitly load a class by Class.forName(class name) and Class.forName(class name, initialized, classloader). JDBC code which is used to load JDBC drives we have seen in Java program to Connect Oracle database.

What is Byte Code Verifier? The JVM verifies all bytecode before it is executed. This verification consists primarily of three types of checks: 1.Branches are always to valid locations 2.Data is always initialized and references are always type-safe 3.Access to private or package private data and methods is rigidly controlled The first two of these checks take place primarily during the verification step that occurs when a class is loaded and made eligible for use. The third is primarily performed dynamically, when data items or methods of a class are first accessed by another class.

Bytecode interpreter and just-in-time compiler For each hardware architecture a different Java bytecode interpreter is needed. When a computer has a Java bytecode interpreter, it can run any Java bytecode program, and the same program can be run on any computer that has such an interpreter. A just-in-time compiler may translate Java bytecode into native machine language while executing the program. The translated parts of the program can then be executed much more quickly than they could be interpreted. This technique gets applied to those parts of a program frequently executed. This way a just-in-time compiler can significantly speed up the overall execution time. Java bytecode is intended to be platform-independent and secure.

JIT A Just-In-Time (JIT) compiler is a feature of the run-time interpreter, that instead of interpreting bytecode every time a method is invoked, will compile the bytecode into the machine code instructions of the running machine, and then invoke this object code instead. Ideally the efficiency of running object code will overcome the inefficiency of recompiling the program every time it runs.

Continue...

JAVA API By default JAR File loaded by Class Loader By default Java Package used by all classes An API (Application Programming Interface) is a collection of packages, a package is the collection of classes, interfaces and sub-packages. A sub-package is a collection of classes interfaces and sub sub packages etc.

Features of Java There is given many features of java.

1)Simple According to Sun, Java language is simple because: syntax is based on C++ (so easier for programmers to learn it after C++). Removed many confusing and/or rarely-used features e.g., explicit pointers, operator overloading etc. No need to remove unreferenced objects because there is Automatic Garbage Collection in java.

Comparison Table of Features(C,C++& Java)

2)Object-oriented Object-oriented means we organize our software as a combination of different types of objects that incorporates both data and behaviour. Object Class Inheritance Polymorphism Abstraction Encapsulation

3) Platform Independent A platform is the hardware or software environment in which a program runs. There are two types of platforms software-based and hardware-based. Java provides software-based platform.

4) Secured No explicit pointer, Programs run inside virtual machine sandbox. Classloader, Bytecode Verifier & Security Manager.

5) Robust Robust simply means strong. Java uses strong memory management. There is automatic garbage collection in java. There is exception handling and type checking mechanism in java. All these points makes java robust.

6) Architecture-neutral Architecture represents processor. A Language or Technology is said to be Architectural neutral which can run on any available processors in the real world without considering there architecture and vendor (providers) irrespective to its development and compilation. The languages like C, CPP are treated as architectural dependent.

7) Portable A portable language is one which can run on all operating systems and run on all processors without considering their vendors and architectures. JAVA is a portable language.

8)High-performance

9)Multithreaded A flow of control is known as thread. When any Language execute multiple thread at a time that language is known as multithreaded Language.

10)Distributed We can create distributed applications in java. RMI and EJB are used for creating distributed applications.

Java is very powerful ? Java is very powerful language can be used to developed both client server architecture and distributed architecture based application.

Continue...

Java Environment Setup

Continue... Javac is a tool which is available in bin folder so you must set the PATH upto bin folder. In a bin folder all tools are available like javap, javah, jar, javac, java, appletviewer etc. These all tools are used for different-different purpose.

How to set path in Java

1) How to set Temporary Path of JDK in Windows

2) How to set Permanent Path of JDK in Windows

Step-2

Step-3

Step-4

Step-5

Step-6

Step-7

Step-8

Step-9

Step-10

What is Life Cycle of Java?

Example