SlideShare a Scribd company logo
1 of 33
P1WU
UNIT – I: INTRODUCTION TO OOP AND JAVA
TOPIC -3: FEATURES OF OBJECT ORIENTED
PROGRAMMING
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
UNIT I INTRODUCTION TO OOP AND JAVA
1. Overview of OOP
2. Object oriented
programming paradigms
3. Features of Object
Oriented
Programming
4. Java Buzzwords
5. Overview of Java – Data Types,
Variables and Arrays
6.Operators
7.Control Statements
8.Defining classes in Java
9.Constructors
10.Methods
11. Access specifiers
12.Static members
13. JavaDoc comments
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
FEATURES OF OBJECT ORIENTED PROGRAMMING
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
FEATURES OF OBJECT ORIENTED PROGRAMMING
• The Object–Oriented Programming principles are defended with
concepts of Object–Oriented Systems (OOPS)
1. Object
2. Class
3. Encapsulation
4. Abstraction
5. Polymorphism
6. Inheritance
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
a) Object
• An object is a real-world element in an object–oriented
environment that may have a physical or a conceptual existence.
Each object has −
• Identity that distinguishes it from other objects in the system.
• State that determines characteristic properties of an object as well
as values of properties that the object holds.
• Behavior that represents externally visible activities performed by
an object in terms of changes in its state.
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
a) Object
• Objects can be modeled according to the needs of the application.
• An object may have a physical existence, like a customer, a car, etc.;
or an intangible conceptual existence, like a project, a process, etc.
• Object means a real word entity such as pen, chair, table etc.
• Any entity that has state and behavior is known as an object.
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
a) Object
• Object can be defined as an instance of a class.
• An object contains an address and takes up some space in
memory.
• Objects can communicate without knowing details of :
• each other's data or code,
• the only necessary thing is that the type of message accepted and
• type of response returned by the objects.
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
a) Object
• An object has three characteristics:
• state: represents data (value) of an object.
• behavior: represents the behavior (functionality) of an
object such as deposit, withdraw etc.
• identity: Object identity is typically implemented via a
unique ID.
• The value of the ID is not visible to the external user. But, it
is used internally by the JVM to identify each object
uniquely.
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
b) Class
• A class represents a collection of objects having same
characteristic properties that exhibit common behavior.
• It gives the blueprint or the description of the objects that can be
created from it.
• Creation of an object as a member of a class is called instantiation.
• Collection of objects is called class.
• It is a logical entity.
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
b) Class
• A class can also be defined as a blueprint from which you can
create an individual object.
• A class consists of Data members and methods.
• The primary purpose of a class is to hold data/information.
• The member functions determine the behavior of the class,
• i.e. provide a definition for supporting various operations on data held in
the form of an object.Class doesn’t store any space.
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
b) Class
• Thus, an object is an instance of a class.
• The constituents of a class are −
1. A set of attributes for the objects that are to be instantiated
from the class.
• Generally, different objects of a class have some difference in the values of the
attributes.
• Attributes are often referred as class data.
2. A set of operations that portray the behavior of the objects of
the class. Operations are also referred as functions or
methods
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
b) Class
• Example
• Let us consider a simple class, Circle, that represents the
geometrical figure circle in a two–dimensional space.
• The attributes of this class can be identified as follows −
• x–coord, to denote x–coordinate of the center
• y–coord, to denote y–coordinate of the center
• a, to denote the radius of the circle
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
b) Class
• Some of its operations can be defined as follows −
1. findArea(), a method to calculate area
2. findCircumference(), a method to calculate circumference
3. scale(), a method to increase or decrease the radius
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
c) Encapsulation
• Encapsulation is
• the process of binding both attributes and methods together within a
class.
• Encapsulation in java is a process of wrapping code and data
together into a single unit,
• for example capsule i.e. mixed of several medicines.
• Through encapsulation, the internal details of a class can be
hidden from outside.
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
c) Encapsulation
• It permits
• the elements of the class
to be accessed from
outside only through the
interface provided by the
class.
• A java class is the
example of
encapsulation.
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
d) Abstraction
• Abstraction is
• a process of hiding the implementation details and showing
only functionality to the user.
• Example:
• phone call, we don't know the internal processing.
• In java, we use abstract class and interface to achieve
abstraction.
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
e) Polymorphism
• Polymorphism is originally a Greek word that means the ability to
take multiple forms.
• Ploy  Many
• Morphism  Form
• In object-oriented paradigm, polymorphism implies:
• using operations in different ways, depending upon the
instances they are operating upon.
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
e) Polymorphism
• Polymorphism allows
• objects with different internal structures to have a common
external interface.
• Use:
• Polymorphism is particularly effective while implementing
inheritance.
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
e) Polymorphism : Example
• Let us consider two classes,
• Circle class
• Square class
• Look for Poly- method called findArea().
• Here, Circle and Square, each with a method findArea().
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
e) Polymorphism : Example
• Though the name and purpose of the methods in the
classes are same, the internal implementation,
• i.e., the procedure of calculating an area is different for each
class.
• When an object of class Circle invokes its findArea()
method,
• the operation finds the area of the circle without any conflict
with the findArea() method of the Square class.
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
e) Polymorphism : Example
• When one task is performed
by different ways i.e. known
as polymorphism.
• For example: to convince the
customer differently, to draw
something e.g. shape or
rectangle etc.
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
Types of Polymorphism
• Polymorphism is classified into two ways:
1) Method Overloading(Compile time Polymorphism)
2) Method Overriding(Run time Polymorphism)
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
1) Method Overloading(Compile time Polymorphism)
• Method Overloading is a feature that allows
• a class to have two or more methods having the same name
but the arguments passed to the methods are different.
• Compile time polymorphism refers to
• a process in which a call to an overloaded method is resolved at
compile time rather than at run time.
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
2) Method Overriding(Run time Polymorphism)
• If subclass (child class) has the same method as declared
in the parent class, it is known as method overriding in
java.
• If subclass provides the specific implementation of the
method that has been provided by one of its parent class,
it is known as method overriding.
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
f) Inheritance
• It is a mechanism that permits
• new classes to be created out of existing classes by extending and refining
its capabilities.
Scenario: Having / implementing more than one class
• The existing classes are called the base classes/parent
classes/super-classes, and
• the new classes are called the derived classes/child
classes/subclasses.
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
f) Inheritance
• Facility from inherit property:
• The subclass can inherit or derive the attributes and methods of
the super-class (es) provided that the super-class allows so.
• Besides, the subclass may add its own attributes and methods and
may modify any of the super-class methods. Inheritance defines a
“is – a” relationship.
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
f) Inheritance
• What is an Inheritance?
• Inheritance can be defined as the procedure or mechanism of
acquiring all the properties and behavior of one class to another,
i.e., acquiring the properties and behavior of child class from the
parent class.
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
f) Inheritance
• When one object acquires all the properties and behaviours of
another object, it is known as inheritance.
• It provides code reusability and establishes relationships between
different classes.
• A class which inherits the properties is known as Child Class(sub-
class or derived class) whereas a class whose properties are
inherited is known as Parent class(super-class or base class).
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
f) Inheritance
• Types of inheritance
• Types of inheritance in java:
1. single,
2. multilevel and
3. hierarchical inheritance.
• Multiple and hybrid inheritance is supported through interface
only.
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
f) Inheritance
• Example
• From a class Mammal, a number of classes can be derived such as
Human, Cat, Dog, Cow, etc. Humans, cats, dogs, and cows all have
the distinct characteristics of mammals.
• In addition, each has its own particular characteristics.
• It can be said that a cow “is – a” mammal.
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
Features of object oriented programming paradigm
1. Programs are divided into simple elements referred to as object
2. Focus is on properties and functions rather than procedure.
3. Data is hidden from external functions.
4. Functions operate on the properties of an object.
5. Objects may communicate with each other through a function
called messaging.
6. Follow the bottom-up approach in oop design
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
THANK YOU
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
SEMESTER – III
UNIT I INTRODUCTION TO OOP AND JAVA

More Related Content

What's hot

Oops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in JavaOops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in JavaMadishetty Prathibha
 
Java Data Types
Java Data TypesJava Data Types
Java Data TypesSpotle.ai
 
Object Oriented Analysis and Design
Object Oriented Analysis and DesignObject Oriented Analysis and Design
Object Oriented Analysis and DesignHaitham El-Ghareeb
 
Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Michelle Anne Meralpis
 
Object Oriented Design Concept
Object Oriented Design ConceptObject Oriented Design Concept
Object Oriented Design ConceptSharath g
 
Object oriented-systems-development-life-cycle ppt
Object oriented-systems-development-life-cycle pptObject oriented-systems-development-life-cycle ppt
Object oriented-systems-development-life-cycle pptKunal Kishor Nirala
 
Lecture 1 introduction to vb.net
Lecture 1   introduction to vb.netLecture 1   introduction to vb.net
Lecture 1 introduction to vb.netMUKALU STEVEN
 
Need of object oriented programming
Need of object oriented programmingNeed of object oriented programming
Need of object oriented programmingAmar Jukuntla
 
UNIFIED MODELING LANGUAGE
UNIFIED MODELING LANGUAGEUNIFIED MODELING LANGUAGE
UNIFIED MODELING LANGUAGERaval Chirag
 
POP vs OOP Introduction
POP vs OOP IntroductionPOP vs OOP Introduction
POP vs OOP IntroductionHashni T
 
Overview of UML Diagrams
Overview of UML DiagramsOverview of UML Diagrams
Overview of UML DiagramsManish Kumar
 
OOPS In JAVA.pptx
OOPS In JAVA.pptxOOPS In JAVA.pptx
OOPS In JAVA.pptxSachin33417
 
Data Types, Variables, and Operators
Data Types, Variables, and OperatorsData Types, Variables, and Operators
Data Types, Variables, and OperatorsMarwa Ali Eissa
 
Uml diagrams
Uml diagramsUml diagrams
Uml diagramsbarney92
 

What's hot (20)

Oops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in JavaOops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in Java
 
Cohesion and coupling
Cohesion and couplingCohesion and coupling
Cohesion and coupling
 
Java Data Types
Java Data TypesJava Data Types
Java Data Types
 
Object Oriented Analysis and Design
Object Oriented Analysis and DesignObject Oriented Analysis and Design
Object Oriented Analysis and Design
 
Oomd unit1
Oomd unit1Oomd unit1
Oomd unit1
 
Oops in Java
Oops in JavaOops in Java
Oops in Java
 
Object model
Object modelObject model
Object model
 
Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)
 
Object Oriented Design Concept
Object Oriented Design ConceptObject Oriented Design Concept
Object Oriented Design Concept
 
Object oriented-systems-development-life-cycle ppt
Object oriented-systems-development-life-cycle pptObject oriented-systems-development-life-cycle ppt
Object oriented-systems-development-life-cycle ppt
 
Ooad unit – 1 introduction
Ooad unit – 1 introductionOoad unit – 1 introduction
Ooad unit – 1 introduction
 
Lecture 1 introduction to vb.net
Lecture 1   introduction to vb.netLecture 1   introduction to vb.net
Lecture 1 introduction to vb.net
 
Uml
UmlUml
Uml
 
Need of object oriented programming
Need of object oriented programmingNeed of object oriented programming
Need of object oriented programming
 
UNIFIED MODELING LANGUAGE
UNIFIED MODELING LANGUAGEUNIFIED MODELING LANGUAGE
UNIFIED MODELING LANGUAGE
 
POP vs OOP Introduction
POP vs OOP IntroductionPOP vs OOP Introduction
POP vs OOP Introduction
 
Overview of UML Diagrams
Overview of UML DiagramsOverview of UML Diagrams
Overview of UML Diagrams
 
OOPS In JAVA.pptx
OOPS In JAVA.pptxOOPS In JAVA.pptx
OOPS In JAVA.pptx
 
Data Types, Variables, and Operators
Data Types, Variables, and OperatorsData Types, Variables, and Operators
Data Types, Variables, and Operators
 
Uml diagrams
Uml diagramsUml diagrams
Uml diagrams
 

Similar to CS3391 OOP UT-I T3 FEATURES OF OBJECT ORIENTED PROGRAMMING

Object Oriented Programming.pptx
 Object Oriented Programming.pptx Object Oriented Programming.pptx
Object Oriented Programming.pptxShuvrojitMajumder
 
Introduction to OOP concepts
Introduction to OOP conceptsIntroduction to OOP concepts
Introduction to OOP conceptsAhmed Farag
 
OOSE Unit 3 PPT.ppt
OOSE Unit 3 PPT.pptOOSE Unit 3 PPT.ppt
OOSE Unit 3 PPT.pptitadmin33
 
Oose unit 3 ppt
Oose unit 3 pptOose unit 3 ppt
Oose unit 3 pptDr VISU P
 
Introduction to oop and java fundamentals
Introduction to oop and java fundamentalsIntroduction to oop and java fundamentals
Introduction to oop and java fundamentalsAnsgarMary
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming ConceptsAbhigyan Singh Yadav
 
Introduction to oop
Introduction to oopIntroduction to oop
Introduction to oopcolleges
 
Introduction to oop
Introduction to oop Introduction to oop
Introduction to oop Kumar
 
Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)MD Sulaiman
 
object oriented programing lecture 1
object oriented programing lecture 1object oriented programing lecture 1
object oriented programing lecture 1Geophery sanga
 
U1 JAVA.pptx
U1 JAVA.pptxU1 JAVA.pptx
U1 JAVA.pptxmadan r
 

Similar to CS3391 OOP UT-I T3 FEATURES OF OBJECT ORIENTED PROGRAMMING (20)

CS3391 OOP UT-I T2 OBJECT ORIENTED PROGRAMMING PARADIGM.pptx
CS3391 OOP UT-I T2 OBJECT ORIENTED PROGRAMMING PARADIGM.pptxCS3391 OOP UT-I T2 OBJECT ORIENTED PROGRAMMING PARADIGM.pptx
CS3391 OOP UT-I T2 OBJECT ORIENTED PROGRAMMING PARADIGM.pptx
 
CS3391 OOP UT-I T4 JAVA BUZZWORDS.pptx
CS3391 OOP UT-I T4 JAVA BUZZWORDS.pptxCS3391 OOP UT-I T4 JAVA BUZZWORDS.pptx
CS3391 OOP UT-I T4 JAVA BUZZWORDS.pptx
 
Object Oriented Programming.pptx
 Object Oriented Programming.pptx Object Oriented Programming.pptx
Object Oriented Programming.pptx
 
Introduction to OOP concepts
Introduction to OOP conceptsIntroduction to OOP concepts
Introduction to OOP concepts
 
OOSE Unit 3 PPT.ppt
OOSE Unit 3 PPT.pptOOSE Unit 3 PPT.ppt
OOSE Unit 3 PPT.ppt
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
Oose unit 3 ppt
Oose unit 3 pptOose unit 3 ppt
Oose unit 3 ppt
 
Introduction to oop and java fundamentals
Introduction to oop and java fundamentalsIntroduction to oop and java fundamentals
Introduction to oop and java fundamentals
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
 
Introduction to oop
Introduction to oopIntroduction to oop
Introduction to oop
 
Introduction to oop
Introduction to oop Introduction to oop
Introduction to oop
 
CS3391 OOP UT-I T1 OVERVIEW OF OOP
CS3391 OOP UT-I T1 OVERVIEW OF OOPCS3391 OOP UT-I T1 OVERVIEW OF OOP
CS3391 OOP UT-I T1 OVERVIEW OF OOP
 
Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)
 
80410172053.pdf
80410172053.pdf80410172053.pdf
80410172053.pdf
 
Cs2305 programming paradigms lecturer notes
Cs2305   programming paradigms lecturer notesCs2305   programming paradigms lecturer notes
Cs2305 programming paradigms lecturer notes
 
C# by Zaheer Abbas Aghani
C# by Zaheer Abbas AghaniC# by Zaheer Abbas Aghani
C# by Zaheer Abbas Aghani
 
C# by Zaheer Abbas Aghani
C# by Zaheer Abbas AghaniC# by Zaheer Abbas Aghani
C# by Zaheer Abbas Aghani
 
object oriented programing lecture 1
object oriented programing lecture 1object oriented programing lecture 1
object oriented programing lecture 1
 
Lesson 13 object and class
Lesson 13 object and classLesson 13 object and class
Lesson 13 object and class
 
U1 JAVA.pptx
U1 JAVA.pptxU1 JAVA.pptx
U1 JAVA.pptx
 

More from AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING

More from AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING (20)

JAVA PROGRAM CONSTRUCTS OR LANGUAGE BASICS.pptx
JAVA PROGRAM CONSTRUCTS OR LANGUAGE BASICS.pptxJAVA PROGRAM CONSTRUCTS OR LANGUAGE BASICS.pptx
JAVA PROGRAM CONSTRUCTS OR LANGUAGE BASICS.pptx
 
INTRO TO PROGRAMMING.ppt
INTRO TO PROGRAMMING.pptINTRO TO PROGRAMMING.ppt
INTRO TO PROGRAMMING.ppt
 
CS3391 -OOP -UNIT – V NOTES FINAL.pdf
CS3391 -OOP -UNIT – V NOTES FINAL.pdfCS3391 -OOP -UNIT – V NOTES FINAL.pdf
CS3391 -OOP -UNIT – V NOTES FINAL.pdf
 
CS3391 -OOP -UNIT – IV NOTES FINAL.pdf
CS3391 -OOP -UNIT – IV NOTES FINAL.pdfCS3391 -OOP -UNIT – IV NOTES FINAL.pdf
CS3391 -OOP -UNIT – IV NOTES FINAL.pdf
 
CS3391 -OOP -UNIT – III NOTES FINAL.pdf
CS3391 -OOP -UNIT – III  NOTES FINAL.pdfCS3391 -OOP -UNIT – III  NOTES FINAL.pdf
CS3391 -OOP -UNIT – III NOTES FINAL.pdf
 
CS3391 -OOP -UNIT – II NOTES FINAL.pdf
CS3391 -OOP -UNIT – II  NOTES FINAL.pdfCS3391 -OOP -UNIT – II  NOTES FINAL.pdf
CS3391 -OOP -UNIT – II NOTES FINAL.pdf
 
CS3251-_PIC
CS3251-_PICCS3251-_PIC
CS3251-_PIC
 
CS8080 information retrieval techniques unit iii ppt in pdf
CS8080 information retrieval techniques unit iii ppt in pdfCS8080 information retrieval techniques unit iii ppt in pdf
CS8080 information retrieval techniques unit iii ppt in pdf
 
CS8080 IRT UNIT I NOTES.pdf
CS8080 IRT UNIT I  NOTES.pdfCS8080 IRT UNIT I  NOTES.pdf
CS8080 IRT UNIT I NOTES.pdf
 
CS8080_IRT_UNIT - III T14 SEQUENTIAL SEARCHING.pdf
CS8080_IRT_UNIT - III T14 SEQUENTIAL SEARCHING.pdfCS8080_IRT_UNIT - III T14 SEQUENTIAL SEARCHING.pdf
CS8080_IRT_UNIT - III T14 SEQUENTIAL SEARCHING.pdf
 
CS8080_IRT_UNIT - III T15 MULTI-DIMENSIONAL INDEXING.pdf
CS8080_IRT_UNIT - III T15 MULTI-DIMENSIONAL INDEXING.pdfCS8080_IRT_UNIT - III T15 MULTI-DIMENSIONAL INDEXING.pdf
CS8080_IRT_UNIT - III T15 MULTI-DIMENSIONAL INDEXING.pdf
 
CS8080_IRT_UNIT - III T13 INVERTED INDEXES.pdf
CS8080_IRT_UNIT - III T13 INVERTED  INDEXES.pdfCS8080_IRT_UNIT - III T13 INVERTED  INDEXES.pdf
CS8080_IRT_UNIT - III T13 INVERTED INDEXES.pdf
 
CS8080 IRT UNIT - III SLIDES IN PDF.pdf
CS8080  IRT UNIT - III  SLIDES IN PDF.pdfCS8080  IRT UNIT - III  SLIDES IN PDF.pdf
CS8080 IRT UNIT - III SLIDES IN PDF.pdf
 
CS8080_IRT_UNIT - III T11 ORGANIZING THE CLASSES.pdf
CS8080_IRT_UNIT - III T11 ORGANIZING THE CLASSES.pdfCS8080_IRT_UNIT - III T11 ORGANIZING THE CLASSES.pdf
CS8080_IRT_UNIT - III T11 ORGANIZING THE CLASSES.pdf
 
CS8080_IRT_UNIT - III T12 INDEXING AND SEARCHING.pdf
CS8080_IRT_UNIT - III T12 INDEXING AND SEARCHING.pdfCS8080_IRT_UNIT - III T12 INDEXING AND SEARCHING.pdf
CS8080_IRT_UNIT - III T12 INDEXING AND SEARCHING.pdf
 
CS8080_IRT_UNIT - III T11 ORGANIZING THE CLASSES.pdf
CS8080_IRT_UNIT - III T11 ORGANIZING THE CLASSES.pdfCS8080_IRT_UNIT - III T11 ORGANIZING THE CLASSES.pdf
CS8080_IRT_UNIT - III T11 ORGANIZING THE CLASSES.pdf
 
CS8080_IRT_UNIT - III T10 ACCURACY AND ERROR.pdf
CS8080_IRT_UNIT - III T10  ACCURACY AND ERROR.pdfCS8080_IRT_UNIT - III T10  ACCURACY AND ERROR.pdf
CS8080_IRT_UNIT - III T10 ACCURACY AND ERROR.pdf
 
CS8080_IRT_UNIT - III T9 EVALUATION METRICS.pdf
CS8080_IRT_UNIT - III T9 EVALUATION METRICS.pdfCS8080_IRT_UNIT - III T9 EVALUATION METRICS.pdf
CS8080_IRT_UNIT - III T9 EVALUATION METRICS.pdf
 
CS8080_IRT_UNIT - III T8 FEATURE SELECTION OR DIMENSIONALITY REDUCTION.pdf
CS8080_IRT_UNIT - III T8  FEATURE SELECTION OR DIMENSIONALITY REDUCTION.pdfCS8080_IRT_UNIT - III T8  FEATURE SELECTION OR DIMENSIONALITY REDUCTION.pdf
CS8080_IRT_UNIT - III T8 FEATURE SELECTION OR DIMENSIONALITY REDUCTION.pdf
 
CS8080_IRT_UNIT - III T7 SVM CLASSIFIER.pdf
CS8080_IRT_UNIT - III T7 SVM CLASSIFIER.pdfCS8080_IRT_UNIT - III T7 SVM CLASSIFIER.pdf
CS8080_IRT_UNIT - III T7 SVM CLASSIFIER.pdf
 

Recently uploaded

247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 

Recently uploaded (20)

247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 

CS3391 OOP UT-I T3 FEATURES OF OBJECT ORIENTED PROGRAMMING

  • 1. P1WU UNIT – I: INTRODUCTION TO OOP AND JAVA TOPIC -3: FEATURES OF OBJECT ORIENTED PROGRAMMING AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 2. UNIT I INTRODUCTION TO OOP AND JAVA 1. Overview of OOP 2. Object oriented programming paradigms 3. Features of Object Oriented Programming 4. Java Buzzwords 5. Overview of Java – Data Types, Variables and Arrays 6.Operators 7.Control Statements 8.Defining classes in Java 9.Constructors 10.Methods 11. Access specifiers 12.Static members 13. JavaDoc comments AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 3. FEATURES OF OBJECT ORIENTED PROGRAMMING AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 4. FEATURES OF OBJECT ORIENTED PROGRAMMING • The Object–Oriented Programming principles are defended with concepts of Object–Oriented Systems (OOPS) 1. Object 2. Class 3. Encapsulation 4. Abstraction 5. Polymorphism 6. Inheritance AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 5. a) Object • An object is a real-world element in an object–oriented environment that may have a physical or a conceptual existence. Each object has − • Identity that distinguishes it from other objects in the system. • State that determines characteristic properties of an object as well as values of properties that the object holds. • Behavior that represents externally visible activities performed by an object in terms of changes in its state. AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 6. a) Object • Objects can be modeled according to the needs of the application. • An object may have a physical existence, like a customer, a car, etc.; or an intangible conceptual existence, like a project, a process, etc. • Object means a real word entity such as pen, chair, table etc. • Any entity that has state and behavior is known as an object. AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 7. a) Object • Object can be defined as an instance of a class. • An object contains an address and takes up some space in memory. • Objects can communicate without knowing details of : • each other's data or code, • the only necessary thing is that the type of message accepted and • type of response returned by the objects. AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 8. a) Object • An object has three characteristics: • state: represents data (value) of an object. • behavior: represents the behavior (functionality) of an object such as deposit, withdraw etc. • identity: Object identity is typically implemented via a unique ID. • The value of the ID is not visible to the external user. But, it is used internally by the JVM to identify each object uniquely. AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 9. b) Class • A class represents a collection of objects having same characteristic properties that exhibit common behavior. • It gives the blueprint or the description of the objects that can be created from it. • Creation of an object as a member of a class is called instantiation. • Collection of objects is called class. • It is a logical entity. AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 10. b) Class • A class can also be defined as a blueprint from which you can create an individual object. • A class consists of Data members and methods. • The primary purpose of a class is to hold data/information. • The member functions determine the behavior of the class, • i.e. provide a definition for supporting various operations on data held in the form of an object.Class doesn’t store any space. AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 11. b) Class • Thus, an object is an instance of a class. • The constituents of a class are − 1. A set of attributes for the objects that are to be instantiated from the class. • Generally, different objects of a class have some difference in the values of the attributes. • Attributes are often referred as class data. 2. A set of operations that portray the behavior of the objects of the class. Operations are also referred as functions or methods AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 12. b) Class • Example • Let us consider a simple class, Circle, that represents the geometrical figure circle in a two–dimensional space. • The attributes of this class can be identified as follows − • x–coord, to denote x–coordinate of the center • y–coord, to denote y–coordinate of the center • a, to denote the radius of the circle AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 13. b) Class • Some of its operations can be defined as follows − 1. findArea(), a method to calculate area 2. findCircumference(), a method to calculate circumference 3. scale(), a method to increase or decrease the radius AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 14. c) Encapsulation • Encapsulation is • the process of binding both attributes and methods together within a class. • Encapsulation in java is a process of wrapping code and data together into a single unit, • for example capsule i.e. mixed of several medicines. • Through encapsulation, the internal details of a class can be hidden from outside. AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 15. c) Encapsulation • It permits • the elements of the class to be accessed from outside only through the interface provided by the class. • A java class is the example of encapsulation. AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 16. d) Abstraction • Abstraction is • a process of hiding the implementation details and showing only functionality to the user. • Example: • phone call, we don't know the internal processing. • In java, we use abstract class and interface to achieve abstraction. AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 17. e) Polymorphism • Polymorphism is originally a Greek word that means the ability to take multiple forms. • Ploy  Many • Morphism  Form • In object-oriented paradigm, polymorphism implies: • using operations in different ways, depending upon the instances they are operating upon. AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 18. e) Polymorphism • Polymorphism allows • objects with different internal structures to have a common external interface. • Use: • Polymorphism is particularly effective while implementing inheritance. AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 19. e) Polymorphism : Example • Let us consider two classes, • Circle class • Square class • Look for Poly- method called findArea(). • Here, Circle and Square, each with a method findArea(). AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 20. e) Polymorphism : Example • Though the name and purpose of the methods in the classes are same, the internal implementation, • i.e., the procedure of calculating an area is different for each class. • When an object of class Circle invokes its findArea() method, • the operation finds the area of the circle without any conflict with the findArea() method of the Square class. AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 21. e) Polymorphism : Example • When one task is performed by different ways i.e. known as polymorphism. • For example: to convince the customer differently, to draw something e.g. shape or rectangle etc. AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 22. Types of Polymorphism • Polymorphism is classified into two ways: 1) Method Overloading(Compile time Polymorphism) 2) Method Overriding(Run time Polymorphism) AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 23. 1) Method Overloading(Compile time Polymorphism) • Method Overloading is a feature that allows • a class to have two or more methods having the same name but the arguments passed to the methods are different. • Compile time polymorphism refers to • a process in which a call to an overloaded method is resolved at compile time rather than at run time. AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 24. 2) Method Overriding(Run time Polymorphism) • If subclass (child class) has the same method as declared in the parent class, it is known as method overriding in java. • If subclass provides the specific implementation of the method that has been provided by one of its parent class, it is known as method overriding. AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 25. f) Inheritance • It is a mechanism that permits • new classes to be created out of existing classes by extending and refining its capabilities. Scenario: Having / implementing more than one class • The existing classes are called the base classes/parent classes/super-classes, and • the new classes are called the derived classes/child classes/subclasses. AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 26. f) Inheritance • Facility from inherit property: • The subclass can inherit or derive the attributes and methods of the super-class (es) provided that the super-class allows so. • Besides, the subclass may add its own attributes and methods and may modify any of the super-class methods. Inheritance defines a “is – a” relationship. AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 27. f) Inheritance • What is an Inheritance? • Inheritance can be defined as the procedure or mechanism of acquiring all the properties and behavior of one class to another, i.e., acquiring the properties and behavior of child class from the parent class. AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 28. f) Inheritance • When one object acquires all the properties and behaviours of another object, it is known as inheritance. • It provides code reusability and establishes relationships between different classes. • A class which inherits the properties is known as Child Class(sub- class or derived class) whereas a class whose properties are inherited is known as Parent class(super-class or base class). AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 29. f) Inheritance • Types of inheritance • Types of inheritance in java: 1. single, 2. multilevel and 3. hierarchical inheritance. • Multiple and hybrid inheritance is supported through interface only. AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 30. f) Inheritance • Example • From a class Mammal, a number of classes can be derived such as Human, Cat, Dog, Cow, etc. Humans, cats, dogs, and cows all have the distinct characteristics of mammals. • In addition, each has its own particular characteristics. • It can be said that a cow “is – a” mammal. AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 31. Features of object oriented programming paradigm 1. Programs are divided into simple elements referred to as object 2. Focus is on properties and functions rather than procedure. 3. Data is hidden from external functions. 4. Functions operate on the properties of an object. 5. Objects may communicate with each other through a function called messaging. 6. Follow the bottom-up approach in oop design AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 32. THANK YOU AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA
  • 33. AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY SEMESTER – III UNIT I INTRODUCTION TO OOP AND JAVA