Java Lecture1
Java Lecture1
TECHNOLOGY
BCA
Semester-III
Object Oriented Programming Using
Java
Prof(Dr)Laxmi Ahuja
Learning Objectives
•Imparting java programming skill to students
• Abstraction
• Encapsulation
• Inheritance
• Polymorphism
Class
• A class describes a collection of objects with similar attributes, operations and
relationship to other objects
• A class is a blueprint or template from which objects are created
• Without class, object does not exist
• Object will follow the prototype defined by class
Class object object object
Student----class
A -----read() write()
B ------ read() write()
C---------- read() write()
A B C are Objects
Identity: Name
State/Attribute: Color,breed,Age
Behavior: eat,run
Human ------Object
Name Color Height------Variables or attributes
Read()
Write()------------------------------Tasks or Methods or behaviour
performed by Human
Example
Student---object
Name Address City -------- Variables or attributes
Address
City
Example:
sending SMS where you type the text and send the message.
Internal processing about the message delivery is not known
Encapsulation
Encapsulation is the mechanism that binds together code and the
data it manipulates , and keeps both safe from outside interference
and misuse.
Mammal Reptile
Dog
Cat
18
The concept of inheritance provides the idea of reusability
Polymorphism
• Polymorphism in Java is a concept by which we can perform a single action in
different ways. So polymorphism means many forms.
20
Continue…..
In java we create methods and methods create different forms
Water------Solid,liquid,gas(Forms of Water)
• Developed by James Gosling and his Team in 1991 at sun Microsystem ,Inc but in 1995
• JAVA is Everywhere
• MANY MORE…..
THANK YOU