Suma D Event Driven programming using java(CSE210) Overview of java Packages and interface Exception handling Multithreading Input/output.

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

Lab Information Security Using Java (Review) Lab#0 Omaima Al-Matrafi.
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.
Java Programming, 3e Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
For more Lectures and Notes Visit
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.
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.
LESSON 1 INTRODUCTION Compiled By: Edwin O. Okech [Tutor, Amoud University] JAVA PROGRAMMING.
CMSC 202 Computer Science II for Majors Fall 2009 Introduction.
Sadegh Aliakbary Sharif University of Technology Fall 2011.
Getting Started What is Java? A programming language –Fully buzzword-compliant: A simple, object oriented, distributed, interpreted, robust, secure,
Introduction to Java Programming. Contents 1. Java, etc. 2. Java's Advantages 3. Java's Disadvantages 4. Types of Java Code 5. Java Bytecodes 6. Steps.
JAVA v.s. C++ Programming Language Comparison By LI LU SAMMY CHU By LI LU SAMMY CHU.
BASIC JAVA PROGRAMMING TUTORIAL. History  James Gosling and Sun Microsystems  Oak  Java, May 20, 1995, Sun World  Hot Java –The first Java-enabled.
Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
CSC 142 A 1 CSC 142 Introduction to Java [Reading: chapter 0]
Introduction to Java Programming with JBuilder 4
CSCI 224 Introduction to Java Programming. Course Objectives  Learn the Java programming language: Syntax, Idioms Patterns, Styles  Become comfortable.
Sadegh Aliakbary Sharif University of Technology Spring 2011.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
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.
Programming Fundamentals 2: Background/ F II Objectives – –give a non-technical overview of Java Semester 2, Background.
CMSC 202 Computer Science II for Majors Object-Oriented Programming.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Programming Languages Machine.
111 © 2002, Cisco Systems, Inc. All rights reserved.
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.
Sadegh Aliakbary Sharif University of Technology Fall 2012.
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.
August 6, 2009 EVENT DRIVEN PROGRAMMING WITH JAVA.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to.
Introduction to Java Programming. Introduction Course Objectives Organization of the Book.
Session 1 Introduction to Java. Objectives Java Simplified / Session 1 / 2 of 32 Explain the history of Java Explain Java in brief List the types of Java.
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.
Chapter 2: A Brief History Object- Oriented Programming Presentation slides for Object-Oriented Programming by Yahya Garout KFUPM Information & Computer.
 Programming Language  Object Oriented Programming  JAVA – An Introduction  JAVA Milestones  JAVA Features.
1 The JAVA Language Object Oriented Technology Mithani Binjan M.
What is Java? Object Oriented Programming Language Sun Microsystems “Write Once, Run Everywhere” Bytecode and Virtual Machine Java Platform (Java VM and.
Introduction Mehdi Einali Advanced Programming in Java 1.
1 Introduction to Java. 2 * 10% Assignments/ class participation * 10% Pop Quizzes * 05% Attendance * 25% Mid Term * 50% Final Term.
การเขียนโปรแกรมภาษา จาวา Java Programming อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา Chapter 1.
ITP 109 Week 2 Trina Gregory Introduction to Java.
Introduction to Programming 1 1 2Introduction to Java.
Introduction to JAVA Programming
JAVA TRAINING IN NOIDA. JAVA Java is a general-purpose computer programming language that is concurrent, class-based, object-oriented and specifically.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Fundamental of Java Programming (630002) Unit – 1 Introduction to Java.
Introduction to Algorithm. What is Algorithm? an algorithm is any well-defined computational procedure that takes some value, or set of values, as input.
Introduction CMSC 202 Fall Instructors Mr. Ryan Bergeron – Lecture Section 01 Tues/Thu 1:00 – 2:15 am, Sondheim 111 – Lecture Section 04 Tues/Thu.
Applications Active Web Documents Active Web Documents.
Object Oriented Programming in
Done By: Ashlee Lizarraga Ricky Usher Jacinto Roches Eli Gomez
Chapter 1 Introduction to Computers, Programs, and Java
Java programming lecture one
Introduction Enosis Learning.
An Overview of Java.
Introduction Enosis Learning.
(Computer fundamental Lab)
Java History, Editions, Version Features
By Rajanikanth B Overview Of Java By Rajanikanth B
F II 1. Background Objectives
Introducing Java.
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:

Suma D

Event Driven programming using java(CSE210) Overview of java Packages and interface Exception handling Multithreading Input/output Applet Event handling AWT Database Swings servlets

Course objectives Develop programs on Eclipse platform Write simple programs using primitive data types, control statements classes methods etc. Develop GUI Develop applets Write interesting java projects Establishing firm foundation on java’s basic concepts

Java History In 1991, Sun Microsystems set up a research project to develop a language for programming ‘intelligent’ consumer electronics –e.g. video recorders, TVs, toasters The language was called Oak (later changed to Java). Developed by James Gosling, and others.

August 1993: the project was cancelled after two commercial deals fell through.August 1993: the project was cancelled after two commercial deals fell through. The Web became popular during 1993.The Web became popular during July 1994: Sun restarted work on Java as a Web programming language.July 1994: Sun restarted work on Java as a Web programming language. Java contains networking features, platform portability, and a small runtime systemJava contains networking features, platform portability, and a small runtime system

Java released May 1995 –Netscape supported Java in Navigator 2.0, which gave it an enormous boost May 1996: JDK 1.0 released. February 1997: JDK 1.1 released –major changes in the event model used by the GUI; inner classes introduced

December 1998: JDK 1.2 released –also known as Java 2 –much improved GUIs (Swing), graphics September 2000: J2SDK 1.3 released –still known as Java 2 –improved networking, sound, security

February 2002: J2SE 1.4 released –still known as Java 2 –improved I/O, GUI improvements, increase in standard libraries (62% more classes!) September 2004: J2SE 1.5 released –also known as J2SE 5.0 –the language is still Java 2 –new stuff: easy IO, generics, enumerated types, concurrency tools, faster speed, improved monitoring/profiling/debugging

Newest version of java is JavaSE6(java platform standard edition 6) Enhancement of API libraries Addition of new packages Improvements to the run time

J2SE,JSDK,JDK,JRE,J2EE,J2ME J2SE-Java 2 standard edition JSDK +JRE =J2SE. JSDK-Java software development kit JRE-java run time environment JSDK contains all the libraries (packages), compiler, and other tools for writing/running/debugging Java code. JRE = "Java Runtime Environment" –a cut-down version of JSDK with only the packages/tools needed for running Java code –most often used by Web browsers

J2SE,JSDK,JDK,JRE,J2EE,J2ME JDK-old name of JSDK sometimes JSDK is called as J2SDK,java SDK. J2EE- java 2 Enterprise edition J2ME-java 2 microedition

Types of java programs Applications An application is a program that runs on your computer, under the operating system of that computer –ordinary programs; stand-alone –they don’t run inside a browser (but they can use Java’s GUI libraries) Applets An applet is an application designed to be transmitted over the Internet and executed by a Java-compatible Web browser

–they run in a Web browser –they are attached to Web pages, so can be downloaded easily from anywhere –applets have access to browser features An applet is actually a tiny Java program, dynamically downloaded across the network, just like an image, sound file, or video clip An applet is a program that can react to user input and dynamically change—not just run the same animation or sound over and over

Java bytecode The output of a Java compiler(javac) is not executable code ; rather, it is bytecode Bytecode is a highly optimized set of instructions designed to be executed by the Java run-time system, which is called the Java Virtual Machine (JVM)

–a set of instructions similar to machine code –not specific to any machine architecture A class file (holding bytecodes) can be run on any machine which has a Java runtime environment

The Bytecode Advantage Java code (.java file) javac (Windows) javac (Mac) javac (Linux) Java bytecode (.class file) Java runtime (Windows) Java runtime (Mac) Java runtime (Linux)

JVM is an interpreter for bytecode

Translating a Java program into bytecode helps makes it much easier to run a program in a wide variety of environments The reason is straightforward: only the JVM needs to be implemented for each platform When a program is interpreted, it generally runs substantially slower than it would run if compiled to executable code The use of bytecode enables the Java run-time system to execute programs much faster than you might expect

Sun supplies its Just In Time (JIT) compiler for bytecode, which is included in the Java 2 release When the JIT compiler is part of the JVM, it compiles bytecode into executable code in real time, on a piece-by-piece, demand basis The JIT compiles code as it is needed, during execution

The Java Buzzwords Simple Secure Portable Object-oriented Robust Multithreaded Architecture-neutral Interpreted High performance Distributed Dynamic

Simple If you already understand the basic concepts of object-oriented programming, learning Java will be even easier Because Java inherits the C/C++ syntax and many of the object-oriented features of C++, most programmers have little trouble learning Java Beyond its similarities with C/C++, Java has another attribute that makes it easy to learn: it makes an effort not to have surprising features

Object oriented The object model in Java is simple and easy to extend, while simple types, such as integers, are kept as high-performance nonobjects

Robust Ability to create robust programs was given a high priority in the design of Java To better understand how Java is robust, consider two of the main reasons for program failure: memory management mistakes and mishandled exceptional conditions (that is, run-time errors)

Memory management can be a difficult, tedious task in traditional programming environments For example, in C/C++, the programmer must manually allocate and free all dynamic memory Programmers will either forget to free memory that has been previously allocated or, worse, try to free some memory that another part of their code is still using

Java virtually eliminates these problems by managing memory allocation and deallocation for you Java provides object-oriented exception handling

Multithreaded Java supports multithreaded programming, which allows you to write programs that do many things simultaneously The Java run-time system comes with an elegant yet sophisticated solution for multiprocess synchronization that enables you to construct smoothly running interactive systems

Architecture-Neutral Operating system upgrades, processor upgrades, and changes in core system resources can all combine to make a program malfunction Java Virtual Machine in an attempt to alter this situation Their goal was “write once; run anywhere, any time, forever.”

Interpreted and High Performance Java enables the creation of cross-platform programs by compiling into an intermediate representation called Java bytecode This code can be interpreted on any system that provides a Java Virtual Machine the Java bytecode was carefully designed so that it would be easy to translate directly into native machine code for very high performance by using a just-in-time compiler

Distributed Java is designed for the distributed environment of the Internet, because it handles TCP/IP protocols Remote Method Invocation (RMI) feature of Java brings an unparalleled level of abstraction to client/server programming

Dynamic Java programs carry with them substantial amounts of run-time type information that is used to verify and resolve accesses to objects at run time.

An overview of java Object-oriented programming is at the core of Java all computer programs consist of two elements: code and data A program can be conceptually organized around its code or around its data

That is, some programs are written around “what is happening” and others are written around “who is being affected.” The first way is called the process- oriented model The process-oriented model can be thought of as code acting on data

The second approach, Object-oriented programming organizes a program around its data (that is, objects) and a set of well-defined interfaces to that data

Concept of Abstraction An essential element of OOP Humans manage complexity thro’abstraction Abstraction is managed thro’ hierarchy The data from traditional process oriented program can be transformed by abstraction into its component objects.A sequence of process steps can become collection of messages between these objects.

Thus each of these objects describes its own unique behavior. You can treat these objects as concrete entities that respond to messages telling them to do something.

The Three OOP Principles: Encapsulation - is the mechanism that binds together code and the data it manipulates, and keeps both safe from outside interference and misuse Inheritance - the process by which one object acquires the properties of another object

Polymorphism - is a feature that allows one interface to be used for a general class of actions. The specific action is determined by the exact nature of the situation. Balanced use of these 3 principles in your program makes the program robust and scalable than process oriented program