You are on page 1of 14

BITS Pilani Ms.

Prafulla Kalapatapu
Computer Science & Information Systems Group
BITS-Pilani Hyderabad Campus
BITS Pilani prafulla@hyderabad.bits-pilani.ac.in
Hyderabad Campus
BITS Pilani
Hyderabad Campus

Object Oriented Programming


I Semester 2013-2014
Course Assessment
Evaluation
Component Mode Weightage
Test-1 Closed Book 20%
Test-2 Closed Book 20%
Surprise Open Book 5%
Assessment
Lab Open Book 20%
Comprehensive Closed Book 35%

Instructors : Ms. Kavitha


Mr. Sada Siva Rao Myneni
Chamber Consultation hours
Chamber : B204
Monday : 2:00 PM to 3:00 PM
Email : prafulla@hyderabad.bits-pilani.ac.in
Notices:
IPC Notice Board & Course Management site
CS F213/IS F213 OOP First Semester 2013-14 BITS Pilani, Hyderabad Campus
Course Reference
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

CS F213/IS F213 OOP First Semester 2013-14 BITS Pilani, Hyderabad Campus
Todays Agenda

What is Object Oriented Programming.

Properties of OOP.

History and OOP Features.

Encapsulation.

CS F213/IS F213 OOP First Semester 2013-14 BITS Pilani, Hyderabad Campus
Object Oriented Programming

Object Oriented Programming

To perform
some task

Consists

An Entity in real World Data + Instructions

CS F213/IS F213 OOP First Semester 2013-14 BITS Pilani, Hyderabad Campus
What an Object Consists?

What an Object Consists?

has
Properties

does
Behaviour / Operations

CS F213/IS F213 OOP First Semester 2013-14 BITS Pilani, Hyderabad Campus
Languages with object oriented
properties
Few of them are

C++
JAVA
Small Talk
C#

CS F213/IS F213 OOP First Semester 2013-14 BITS Pilani, Hyderabad Campus
What are object oriented
properties?

There are 4 properties

1. Encapsulation
If any language satisfies these 4
2. Abstraction
properties, then we can call it as
3. Polymorphism object oriented programming
4. Inheritance language.

CS F213/IS F213 OOP First Semester 2013-14 BITS Pilani, Hyderabad Campus
Single line definition for each of
above properties
1. Encapsulation : Combining data and code together at one place.
Data +
code
2. Abstraction : hiding essential details and unhiding the non-essential
details. a

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

4. Inheritance : Deriving one from an existing one.


A

B
CS F213/IS F213 OOP First Semester 2013-14 BITS Pilani, Hyderabad Campus
JAVA

History of JAVA

1. First name was OAK


Because it got
registered by other
company

Renamed to JAVA

By

Mr. James Gosling Team

2. It was developed for Electronic devices.


CS F213/IS F213 OOP First Semester 2013-14 BITS Pilani, Hyderabad Campus
Features of JAVA [1]

1. Simple:
[ follows C,C++ syntax rules]

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

Pointers Why eliminated from Java

- Pointers break security


- Memory allocation and deallocation problem
- So, pointers leads to confusion to a programmer

CS F213/IS F213 OOP First Semester 2013-14 BITS Pilani, Hyderabad Campus
Features of JAVA [2]

2. Distributed:

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


one system to other in the network

Eg: Client- Server program

Request
Client Server

Response

CS F213/IS F213 OOP First Semester 2013-14 BITS Pilani, Hyderabad Campus
Features of JAVA [3]

3. Robust: Strong
There are 2 reasons to say it Robust
- Exception Handling
- Memory Management by JVM

S1 If Memory management
S2 [allocation & deallocation]
S3 not there, program may crash
. at runtime [lack of memory]
. Exception In JAVA, JVM will take care of
S25 (An error at that
. runtime)
.
. Abnormal Termination from program [loss of
S100 data, user does not know what happened]

CS F213/IS F213 OOP First Semester 2013-14 BITS Pilani, Hyderabad Campus