Computer Applications - Java - Objects & Classes
SeemantaBhowmick1
6 views
15 slides
Sep 14, 2025
Slide 1 of 15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
About This Presentation
Objects & Classes in java
Size: 1.7 MB
Language: en
Added: Sep 14, 2025
Slides: 15 pages
Slide Content
Ch.3: Elementary Concept of Objects and Classes
What is an Object? Object is a fundamental unit of Object Oriented Programming (OOP) and represents the real world entities. An object is an instance of a class . An object is an identifiable entity with some characteristics (or properties or attributes), a state and a behavior. A set of related objects may exchange data and information to interact with each other.
Illustration of Objects
Objects are Instances of the Class In Object Oriented Programming approach, each object is created from a class. The data members and member functions of the class gets embedded automatically within an object at the time of its creation. Once a class, the user defined data type is defined, multiple instances based on the specifications of the class can be created. Classes are conceptual entities but objects are real entities based on the design of a class. And hence the objects are known as instances of the class.
Features of Objects All objects have three features encapsulated which are follows: State – It is represented by the attributes or characteristics of an object. It also reflects all of the (static) properties of the object plus the current (dynamic) values of each of these properties.
Features of Objects (continued) Behaviour – It is represented by the methods of an object. It also reflects the response of an object with other objects. Identity – It gives a unique name to an object for identification and enables an object to interact with other objects.
Illustration of Features of Objects
What is a Class? A class is a blueprint of a set of objects that have a common structure and common behaviour. A class defines the structure (characteristics and behavior) of objects based on which actual objects are created. In OOP, a class is also termed as Object Factory .
Syntax of Class c lass <class name> { // class body // data members // member functions }// end of class
Illustration of Class
Class as Abstractions To implement abstraction in programming terms, you need to define a class to encapsulate the data members and member functions together wrapped in a single unit. Thus, we can say that classes represents an abstraction in the OOP – Object Oriented Programming approach.
Class i s an Object Factory Generally, the term ‘Factory’ is used along with class for creating similar kinds of objects. These objects are created by using all information that share common characteristics and behaviour available in the class. Based on the specifications of class, an object is created. Multiple objects can be created using specifications of the class. Hence we can say that the class is an object factory.
Class as an User Defined Data Type Primitive data types are not sufficient. In the real world, we have m uch more complicated objects. OOP allows us to model real world objects. In Java, there are certain pre-defined data types such as int , float, char, etc. A user may create a data type and declare certain characteristics and behaviour within it. User defined classes combine the data and methods as integrated components. A class acts as an user defined data type and represents a type specifying certain specifications based on the abstraction it is implementing.
Differences between Object and Class Object Class 1. An object is a real and identifiable entity with some characteristics and behaviour. 1. A class is a conceptual entity based on which objects are created. 2. It represents an entity that can store data and its associated functions. 2. A class is a group of similar objects that share common properties and relationships. 3. It is known as an ‘Instance of a Class’. 3. It is known as an ‘Object Factory’.
Assignment 1 Ch.3: Elementary Concept of Objects and Class Define the following: (a) Object (b) Class What are the features of objects? Why is class also known as an ‘object factory’? Why are objects known as ‘instances of the class’? State the differences between an object and a class.