0% found this document useful (0 votes)
52 views

Chapter 3 Values and Data Types

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

Chapter 3 Values and Data Types

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

Chapter – 3

Elementary Concept of Objects and Classes


Modelling entities

What is an entity?
An entity can be a real-world object, either animate or inanimate, that can be
easily identifiable.
Examples : a student ,a pen, a place , a table , a cat , a bank account.

Differentiate Object and Class


Object Class

Real world
Objects
Software

1
Real world object

Real world object VS Software objects

2
Comparative study of Characteristics and data
members

Example 1

Exampl

3
e2

Student Example

4
Comparison between real word object and
software object
Real word object Software object

5
Class and object creation
Syntax to create an object
Classname objectname = new classname();

The New operator


Allocates dynamic memory for the storage of data and
functions belonging to an object.

icecream stick = new icecream();


icecream cone = new icecream();
icecream cup = new icecream();
6
Create objects of the class Fruits

Object is also called as instance of the class


When object of the class is created then it is called
Instantiation
A single class may have any number of instances
7
Object Factory

Message passing

Hint
A class as a specification for objects
 Defines the common data and methods as single unit that will be shared by set of objects.
 A class is a blue print that defines the variables and the methods common to all objects.
 A class is a collection of objects of similar type.

Guess who am I ?
1) I am an entity.
2) I behave like a template.
3) I can have different behavior.
4) I belong to an object.
5) I encapsulate variables and methods in a container.
6) I behave like factory of objects.
7) I hide the complexity of an object

8
ICSE PATTEREN QUESTIONS:
SHORT QUESTIONS ( 2MARKS)

1) Define an object.
2) What is class?
3) Difference between a class and an object.
4) What do you mean by message?
5) What do you mean by message passing?
6) How are classes and objects are related to one another?
7) Why are objects said to be instances of class?
8) Why are classes considered as object factories?
9) Why is class known as composite data type ?
10) Why is class known as user defined data type ?
11) What does a class encapsulate ?
12) Mention five states(characteristics) and two methods for the
following classes
a) Class computer
b) Class book

You might also like