Introduction:
- Java is Object oriented Programming Language.
- Java is not fully object oriented because it is supporting primitive types.
- Wrapper classes providing functionality to convert Primitive data into Objects in java applications.
Object Oriented Programming Features:
- Encapsulation
- Abstraction
- Inheritance
- Polymorphism
Note: Object oriented features neither belongs to java nor to any other programming language. These features are global. Every language can implement the functionality of Oriented Programming features. OOP functionality can be implemented using ‘Object and Class’.
Object: A real world entity consists
Identity: Every object has unique identity. We use identities to call the objects.
Variables/State: Are used to store object information. Object information (state) is not constant.
Methods/behavior: Are used to process the information of object. Behavior can be used to change the State of Object.
Object type: Human
Identity: Amar
Properties: age, qualification, mobile_no, mail_id..…
Functionalities: walk () , see() , run() , teach(), swim() , drive()….
Object type: Laptop
Identity: Lenovo
Properties: color, model, weight, configuration…
Functionalities: calculate () , play() , store() , send()….
Class can be described as:
- Class is a keyword
- Class is called user defined data type(extension to structure in C and C++)
- In Java application, every statement belongs to class.
- Class is the complete representation of Object.
- Without class definition, we cannot create object.
- We define objects in application for communication.
- In Communication process, different types of objects will participate.
- The functionality of these objects can be represented by different models(classes) as follows
- POJO class
- Bean class
- Mutable class
- Immutable class
- Final class
- Abstract class
- Interface
- Factory class
- Singleton class
- Exception class
- Thread class
- Generic class
- Annotation