0% found this document useful (0 votes)
653 views10 pages

Elementary Concepts OF Objects and Classes

Objects and classes are fundamental units of object-oriented programming. An object represents a real-world entity with characteristics (data members) and behaviors (methods). A class defines a template for objects with common characteristics and behaviors. Objects are instances of classes - they are created using the class blueprint but each object has unique attribute values. Classes allow for creation of multiple objects that share the same structure and functionality defined in the class.

Uploaded by

Gurmehar Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
653 views10 pages

Elementary Concepts OF Objects and Classes

Objects and classes are fundamental units of object-oriented programming. An object represents a real-world entity with characteristics (data members) and behaviors (methods). A class defines a template for objects with common characteristics and behaviors. Objects are instances of classes - they are created using the class blueprint but each object has unique attribute values. Classes allow for creation of multiple objects that share the same structure and functionality defined in the class.

Uploaded by

Gurmehar Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Elementary Concepts OF

objects and classes


By: Gurmehar Singh
Introduction:

 An Object Oriented Programming(OOP) Language not only promotes features like data abstraction,
Encapsulation, inheritance and Polymorphism but it also correlates two more basic units (i.e. Objects
and Classes).
 In this Presentation we will discuss the features and properties of objects and classes applicable to real
world as well as to software world.
OBJECTS:

 An object is a fundamental unit of Object Oriented Programming(OOP) and represents real life entities
 Objects are of Two types in Java Programming:

 Real World Objects

 Software Objects
Real world objects:

 Real World Objects are the objects which we experience or use in our everyday life.
 We can identify an Object for a Real World Object by the following features:

 If it is visible to us, and

 If it has a definite shape and size

 If it can be brought into thoughts and figures


 For example: A mobile Phone can be defined as a real world object that possess some characteristics and behaviors as explained below:

The characteristics are:

■ Model

■ Dial Pad

■ App

The Behaviors are:

■ It is used to talk

■ It is used to browse the internet

■ It is also used for net banking


Software objects:

 A Software may be defined as an object that is created while writing a Java Program.
 The characteristics and behaviors of real world objects are referred to as data members and member
functions(methods) of software objects respectively.
REAL WORLD OBJECTS VS SOFTWARE OBJECTS

 The states or characteristics of the real world objects are considered to be data members in the software
objects
 The behavior in the real world objects are referred to as the functions or methods in the software objects.
Class:

 As we have learnt earlier an object is a unique entity possessing some characteristics and behavior. Now,
you might be thinking that from where these characteristics and behavior are embedded in an object.
 This is done with the help of a Class. A class can be defined as a blueprint or template for its objects.
 It can also be defined as a category that describes some characteristics and the behavior. Each Object of
a class possesses the characteristics and the behavior(data and functions) described within the class.
 In this way ‘Class’ and its ‘objects’ have a close relationship in an Object Oriented Programming
System.
 For Example: If we define a class called ‘fruits’, then it may describe the color, taste and shape as
characteristics and used for making juice, used for festive occasions and used for breakfast as behaviors.
Creating objects of a class

 An Object is called an instance of the class.


 Creating an object of a class is said to be instantiation. All the instances share the state(attribute) and the
behavior described within the class. But, the attributes(i.e. states) are unique for each object.
 A single class may have any number of instances.
 Syntax(format) of creating an Object of a Class

<Class Name><Object Name> = new <Class Name>();


Attributes are the
characteristics or data
members of an object.

You might also like