Chapter 3 Values and Data Types
Chapter 3 Values and Data Types
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.
Real world
Objects
Software
1
Real world object
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();
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