19
BITS Pilani Hyderabad Campus BITS Pilani Ms. Prafulla Kalapatapu Computer Science & Information Systems Group BITS-Pilani Hyderabad Campus [email protected]

CS_IS_F213_L1_22May

Embed Size (px)

DESCRIPTION

JAVA object oriented program

Citation preview

  • BITS Pilani Hyderabad Campus

    BITS Pilani Ms. Prafulla Kalapatapu

    Computer Science & Information Systems Group

    BITS-Pilani Hyderabad Campus

    [email protected]

  • BITS Pilani Hyderabad Campus

    Object Oriented Programming Summer term Semester 2015

  • CS F213 OOP Summer Term 2015 Prafulla Kalapatapu BITS Pilani, Hyderabad Campus

    Course Assessment

    Course Reference

    Overview

    Todays Agenda

  • CS F213 OOP Summer Term 2015 Prafulla Kalapatapu BITS Pilani, Hyderabad Campus

    Evaluation

    Chamber Consultation hours

    Chamber : B204

    Tuesday : 4:00 PM to 5:00 PM

    Email : [email protected]

    Notices:

    IPC Notice Board & Course Management site

    Course Assessment

    Component Mode Weightage

    Test-1 Closed Book 20%

    Test-2 Closed Book 20%

    Lab Open Book 20%

    Comprehensive Open+Closed

    Book

    40%

  • CS F213 OOP Summer Term 2015 Prafulla Kalapatapu BITS Pilani, Hyderabad Campus

    Text Books

    T1: Object Oriented Design & Patterns, Cay Horstmann, John Wiley &

    Sons, 2004

    Reference Books

    R1: The complete Reference Java 2, 5th Edition, Herbert Schildt, Tata

    McGraw-Hill Edition

    R2: JavaTMDesign Patterns - A Tutorial, James W. Cooper, Addison-Wesley,

    2000

    R3: Core JAVA 2, Volume I Fundamentals (Seventh Edition), Cay Horstmann and Gary Cornell, Prentice-Hall, 2005

    Course Reference

  • CS F213 OOP Summer Term 2015 Prafulla Kalapatapu BITS Pilani, Hyderabad Campus

    What is Object Oriented Programming.

    Properties of OOP.

    History and OOP Features.

    Encapsulation.

    Overview

  • CS F213 OOP Summer Term 2015 Prafulla Kalapatapu BITS Pilani, Hyderabad Campus

    Object Oriented Programming

    Object Oriented Programming

    Data + Instructions

    To perform some task

    Consists

    An Entity in real World

  • CS F213 OOP Summer Term 2015 Prafulla Kalapatapu BITS Pilani, Hyderabad Campus

    What an Object Consists?

    What an Object Consists?

    has

    does

    Properties

    Behaviour / Operations

  • CS F213 OOP Summer Term 2015 Prafulla Kalapatapu BITS Pilani, Hyderabad Campus

    Few of them are

    C++

    JAVA

    Small Talk

    C#

    Languages with object oriented properties

  • CS F213 OOP Summer Term 2015 Prafulla Kalapatapu BITS Pilani, Hyderabad Campus

    There are 4 properties

    1. Encapsulation

    2. Abstraction

    3. Polymorphism

    4. Inheritance

    What are object oriented properties?

    If any language satisfies these 4

    properties, then we can call it as

    object oriented programming

    language.

  • CS F213 OOP Summer Term 2015 Prafulla Kalapatapu BITS Pilani, Hyderabad Campus

    1. Encapsulation : Combining data and code together at one place.

    2. Abstraction : hiding essential details and unhiding the non-essential

    details.

    3. Polymorphism : One name acts as multiple forms based on user

    interaction.

    4. Inheritance : Deriving one from an existing one.

    Single line definition for each of above properties

    Data + code

    a

    b

    A

    B

  • CS F213 OOP Summer Term 2015 Prafulla Kalapatapu BITS Pilani, Hyderabad Campus

    History of JAVA

    1. First name was OAK

    2. It was developed for Electronic devices.

    JAVA

    Renamed to JAVA

    Because it got

    registered by other

    company

    Mr. James Gosling Team

    By

  • CS F213 OOP Summer Term 2015 Prafulla Kalapatapu BITS Pilani, Hyderabad Campus

    1. Simple:

    [ follows C,C++ syntax rules]

    - Pointers break security

    - Memory allocation and deallocation problem

    - So, pointers leads to confusion to a programmer

    Features of JAVA [1]

    Difficult concepts of C and C++ have been omitted in JAVA

    Pointers Why eliminated from Java

  • CS F213 OOP Summer Term 2015 Prafulla Kalapatapu BITS Pilani, Hyderabad Campus

    2. Distributed:

    Using JAVA, we can write program to send/receive information from

    one system to other in the network

    Eg: Client- Server program

    Features of JAVA [2]

    Client Server

    Request

    Response

  • CS F213 OOP Summer Term 2015 Prafulla Kalapatapu BITS Pilani, Hyderabad Campus

    3. Robust:

    There are 2 reasons to say it Robust

    - Exception Handling

    - Memory Management by JVM

    Features of JAVA [3]

    Strong

    S1 S2 S3 . .

    S25 . . .

    S100

    Exception

    (An error at

    runtime)

    Abnormal Termination from program [loss of

    data, user does not know what happened]

    If Memory management

    [allocation & deallocation]

    not there, program may crash

    at runtime [lack of memory]

    In JAVA, JVM will take care of

    that

  • CS F213 OOP Summer Term 2015 Prafulla Kalapatapu BITS Pilani, Hyderabad Campus

    4. System Independence:

    JAVAs byte code is machine independent

    Features of JAVA [4]

    Java Comp

    iler

    ------------------------

    1.java 1.class

    Consists of byte code

    Runs on any OS

  • CS F213 OOP Summer Term 2015 Prafulla Kalapatapu BITS Pilani, Hyderabad Campus

    5. Portability:

    If a program yields the same results on every machine , then that program

    is called portable.

    - JAVA programs are portable

    Features of JAVA [5]

  • CS F213 OOP Summer Term 2015 Prafulla Kalapatapu BITS Pilani, Hyderabad Campus

    6. Interpreted:

    JAVA uses both compiler and interpreter for the execution

    Features of JAVA [6]

    A program that can analyze

    and execute a program line

    by line

    A program that transforms

    source code into machine

    code in total.

  • CS F213 OOP Summer Term 2015 Prafulla Kalapatapu BITS Pilani, Hyderabad Campus

    7. High Performance:

    Because of the use of interpreter, java programs execution is slow. To

    overcome this problem, along with interpreter, they have introduced JIT

    Compiler [JUST IN TIME]

    8. Multi-Threading:

    Thread

    Multi threading

    Features of JAVA [7]

    Represents individual process, to execute group of

    statements simultaneously

    Multiple processes running at a time.