Elementary Concept of Objects and Classes ICSE Class 9 Computer Applications
Updated 15 October 2026 · Fact-checked
An object is a software model of a real entity that has state (attributes stored in variables) and behaviour (methods). A class is the blueprint that specifies those attributes and methods; it works as an object factory and as a user-defined data type. ICSE Class 9 also tests computation as message passing, that is, objects calling each other's methods.
What Elementary Concept of Objects and Classes is about
Look around a classroom: students, desks, fans and books. Each is an entity with its own details (a fan has a speed; a student has a name and roll number) and things it can do or have done to it (a fan can be switched on; a student can answer). Java models such entities as objects, and describes all objects of one kind with a class.
The CISCE syllabus asks for: modelling entities and their behaviour by objects; a class as a specification for objects and as an object factory; computation as message passing or method calls between objects (with many examples); objects encapsulating state (attributes) and behaviour (methods); and the class as a user-defined data type, a blueprint and a factory that produces similar objects.
In answers, always give a real-life entity with at least two attributes and two behaviours, and in programs show the class, the creation of objects with new, and calls through the dot operator.
Weightage: CISCE publishes no chapter weightage and no question-paper layout for ICSE Class 9 Computer Applications. Class IX is examined by your school: one 100-mark theory paper of 2 hours, plus 100 marks of internal assessment (at least 15 programming assignments and a written project on ethical computing). This is topic 2 of the 2028 syllabus.Source: CISCE ICSE 2028 Computer Applications syllabus, Class IX
Key concepts
- Objects: modelling real entities
An object is an identifiable entity that has:
- State (characteristics or attributes): the data that describe it at a moment. In Java these are stored in variables (data members, also called fields or instance variables).
- Behaviour: the actions it can perform or that can be performed on it. In Java these are methods (member functions).
- Identity: each object is distinct, even if two objects have the same state.
Examples:
- Real-life object: a car. State: colour, model, speed, fuel. Behaviour: start, accelerate, brake.
- A student. State: name, roll number, marks. Behaviour: attend class, write exam, show result.
- A mobile phone. State: brand, battery level, contacts. Behaviour: call, message, charge.
Software objects mirror real ones: the data members hold the state and the methods define the behaviour. The object's methods are the only proper way to change its state, which is encapsulation.
Worked example
(2 marks) Identify two attributes and two behaviours of an object 'Fan'.
Try it first, then show the solutionSolution
- Attributes (state): speed, colour, brand, isOn (any two) - 1 mark.
- Behaviours (methods): switchOn(), switchOff(), changeSpeed() (any two) - 1 mark.
Answer: Attributes: speed and colour. Behaviours: switching on (switchOn()) and changing speed (changeSpeed()).
- A class as a specification and blueprint
A class is a template or blueprint that specifies the data members (attributes) and member methods (behaviour) common to all objects of one kind. It is a description, not a thing: no memory is used for an object's data until an object is created.
An object is an instance of a class. Many objects can be made from one class; each has the same set of attributes, but its own values.
Real-life analogy: the architect's plan of a house is the class; the houses built from it are objects. Each house has rooms in the same places, but the owners and colours can differ.
Java form:
class Lamp
{
boolean isOn; // state
String room;
void switchOn() { isOn = true; } // behaviour
void switchOff() { isOn = false; }
void show() { System.out.println(room + " lamp on? " + isOn); }
}The class name begins with a capital letter by convention; data members and methods go inside the class braces.
Worked example
(2 marks) Distinguish between a class and an object.
Try it first, then show the solutionSolution
- Class: a blueprint/template describing attributes and methods common to a set of objects; a logical entity - 1 mark.
- Object: an instance of a class with its own values, occupying memory; a physical (actual) entity - 1 mark.
Answer: A class is a blueprint that defines the attributes and methods common to a group of objects; it is a logical description. An object is a specific instance of a class, with its own values of those attributes, created in memory.
- A class as an object factory: creating objects with new
A class can be seen as a factory that produces similar objects on demand. Each object is created using the new operator:
Lamp a = new Lamp();- Lamp a declares a reference variable a of type Lamp.
- new Lamp() creates an object in memory (allocates space for its data members) and returns its reference.
- = stores the reference in a.
Members are reached with the dot (.) operator: a.room = "Kitchen"; a.switchOn();
Each object has its own copy of the data members. As run in this study guide:
Lamp a = new Lamp();
Lamp b = new Lamp();
a.room = "Kitchen";
b.room = "Bedroom";
a.switchOn();
a.show();
b.show();
b.switchOn();
a.switchOff();
a.show();
b.show();
Output:
Kitchen lamp on? true
Bedroom lamp on? false
Kitchen lamp on? false
Bedroom lamp on? trueA boolean data member that has not been given a value starts as false; an int starts as 0; a String reference starts as null.
Worked example
(2 marks) Explain the statement: Student s = new Student();
Try it first, then show the solutionSolution
- Student s declares a reference variable s of class type Student - 1 mark.
- new Student() creates a Student object in memory; its reference is stored in s - 1 mark.
Answer: Student s declares a variable s that can refer to a Student object. new Student() creates a new Student object in memory, and the assignment stores a reference to that object in s, so its members can be used as s.member.
- Class as a user-defined data type
Java has built-in (primitive) data types such as int, double and char. A class lets the programmer create a new data type with its own data and functionality.
Once a class Lamp is defined, Lamp can be used like any type to declare variables: Lamp a, b; just as int x, y;
Differences from a primitive type:
- A primitive variable holds a single value (int x = 5;).
- A class-type variable holds a reference to an object that may contain many values of different types and methods to work on them.
Why it is called user-defined: it is designed by the programmer (the user of the language), not built into Java. String and Scanner are classes too, written by Java's designers and supplied in its libraries.
Worked example
(2 marks) Why is a class called a user-defined data type?
Try it first, then show the solutionSolution
- It is created by the programmer, not built into the language - 1 mark.
- Once defined, its name is used to declare variables (objects), just like int or double, and it combines data with methods - 1 mark.
Answer: A class is designed by the programmer rather than built into Java, and once defined its name can be used to declare variables (objects) just like a built-in type; it bundles several data members with methods, so it is a user-defined data type.
- Message passing: computation as method calls
In OOP, objects interact by sending messages to one another. Sending a message means calling a method of an object: the receiving object performs the action using its own data.
Form: objectName.methodName(arguments)
Examples:- p.addCoins(50); sends the message 'add 50 coins' to the object p.
- a.switchOn(); asks lamp a to switch itself on.
- System.out.println("Hi"); sends the message println with the argument "Hi" to the object System.out (the screen output stream).
A message has three parts: the receiving object, the method name and any information (arguments) needed.
Real life: a customer (object) tells a waiter (object) 'bring one dosa' (message with information); the waiter tells the cook; the cook prepares it. Each object does its own job.
Why this matters: the caller does not need to know how the receiving object does the job (abstraction), and the data stays inside the object (encapsulation).
Worked example
(2 marks) What is meant by message passing? Identify the object, method and argument in p.addCoins(50);
Try it first, then show the solutionSolution
- Message passing: objects communicate by calling each other's methods - 1 mark.
- Object: p; method: addCoins; argument: 50 - 1 mark.
Answer: Message passing is the way objects communicate, by calling (invoking) one another's methods. In p.addCoins(50); the receiving object is p, the method is addCoins and the argument is 50.
- Objects encapsulate state and behaviour
An object bundles its state (data members) and behaviour (methods) together. This is encapsulation in action.
Why it helps:
- The data of one object is separate from another's: changing a.isOn does not change b.isOn.
- Methods keep the data valid, e.g. a spend() method can refuse to spend more coins than there are.
- The rest of the program uses the object through its methods and does not need to know the details.
Two references to one object: if Counter c3 = c1; then c3 and c1 refer to the same object; a change through one is seen through the other. As run in this study guide:
Counter c1 = new Counter();
Counter c2 = new Counter();
c1.tick(); c1.tick(); c2.tick();
Counter c3 = c1;
c3.tick();
System.out.println(c1.count + " " + c2.count + " " + c3.count);
Output: 3 1 3
(tick() adds 1 to count.)Worked example
(2 marks) In the program above, why does c1.count print 3 although c1.tick() was called only twice?
Try it first, then show the solutionSolution
- Counter c3 = c1; makes c3 refer to the same object as c1; no new object is created - 1 mark.
- c3.tick() therefore increases the same count to 3, which both c1 and c3 show - 1 mark.
Answer: c3 = c1 copies the reference, not the object, so c1 and c3 point to the same Counter. The call c3.tick() raises that object's count from 2 to 3, so c1.count and c3.count are both 3.
Elementary Concept of Objects and Classes in real life
Each concept, met in an everyday situation. Read the situation, answer the question in your own words, then compare with the model answer. The one-line hook is what to remember.
Class as blueprint
Suppose a cake shop uses one mould to bake many cakes, then decorates each cake differently for different customers.
Relate the mould and the cakes to classes and objects.
Try it first, then show the solutionSolution
- The mould fixes the shape and size of every cake: the class.
- Each cake made from it is an object.
- Decorations (flavour, name written) are each object's own state.
Answer: The mould is the class (blueprint), each cake is an object (instance), and the decorations are the different values of the attributes of each object.
Memory hook: One mould, many cakes.
Message passing
Imagine ordering a pizza on a delivery app: you tap 'Order', the app tells the restaurant, the restaurant tells a delivery rider.
Describe this as objects passing messages.
Try it first, then show the solutionSolution
- Objects: customer, app, restaurant, rider.
- Each sends a request (message) to the next: placeOrder(), preparePizza(), deliver(address).
- Each object does its job with its own data; no one needs to know how the others work.
Answer: Each participant is an object; the requests between them are messages (method calls) such as restaurant.preparePizza() and rider.deliver(address), carrying the needed information as arguments.
Memory hook: Objects talk by calling methods.
State and behaviour
Suppose you track your phone: battery at 40%, Wi-Fi on, and you can charge it, call someone or turn on flight mode.
Separate the state from the behaviour.
Try it first, then show the solutionSolution
- State: battery level 40, wifiOn true.
- Behaviour: charge(), call(number), setFlightMode().
- Behaviour changes state: charge() raises the battery level.
Answer: State is battery level and Wi-Fi status (data members); behaviour is charging, calling and flight mode (methods). Calling a method such as charge() changes the state.
Memory hook: State is what it is; behaviour is what it does.
Topics in this chapter
Elementary Concept of Objects and Classes: syntax and key facts
- Object
- Object = state (data members) + behaviour (methods) + identity
- Instance of a class.
- Creating an object
- ClassName obj = new ClassName();
- new allocates memory; obj holds the reference.
- Message passing
- obj.method(arguments); obj.dataMember
- Dot operator reaches members.
- Three views of a class
- Blueprint (specification); object factory; user-defined data type
- All three in the syllabus.
How the school exam asks Elementary Concept of Objects and Classes
The question patterns to expect, and the method that works for each.
| Question type | How it is asked | Method |
|---|---|---|
| MCQ and assertion-reason (1 mark) | Keyword to create an object; which is a class and which is an object; class as user-defined type. | new creates objects; class = blueprint; object = instance. |
| Short answer (2 marks) | Class vs object; attributes and behaviours of an entity; why a class is an object factory; explain obj.method(). | Define, then give a real-life or Java example. |
| Output (2 marks) | Trace objects changed by method calls; two references to one object. | Keep a separate column of values for each object. |
| Program (15 marks) | Define a class with data members and methods; create objects in main() and call methods. | Class, data members, methods, main(), new, dot calls, output. |
Tricks to remember Elementary Concept of Objects and Classes
Short memory aids. Say each one aloud once, then use it on a question the same day.
Blueprint, Factory, Type
A class is a BFT: Blueprint, Factory, Type.
Use it when: Three views of a class.
SBI
An object has State, Behaviour and Identity.
Use it when: Features of an object.
Dot means 'ask'
a.switchOn() reads 'ask a to switch on'.
Use it when: Message passing.
Elementary Concept of Objects and Classes: exam-level solved questions
Ordered from exam level to HOTS. Cover the solution, write your own, then compare step by step.
Example 1: Creating an object · 1 mark · MCQExam level
Which keyword is used to create an object of a class in Java?
(a) class
(b) new
(c) void
(d) object
Try it first, then show the solutionSolution
- class declares a class; void is a return type.
- new allocates memory for an object.
Answer: (b) new
Example 2: Assertion and reason: blueprint · 1 mark · Assertion-reasonHarder exam level
Assertion (A): Declaring a class does not by itself create any object.
Reason (R): A class is only a specification; objects are created with the new operator.
(a) Both A and R are true and R is the correct explanation of A
(b) Both A and R are true but R is not the correct explanation of A
(c) A is true but R is false
(d) A is false but R is true
Try it first, then show the solutionSolution
- A class describes what objects will be like.
- Objects come into existence only with new; R explains A.
Answer: (a) Both A and R are true and R is the correct explanation of A
Example 3: Trace the lamps · 2 marks · Short answerHarder exam level
Using the Lamp class (switchOn() sets isOn to true, switchOff() sets it to false, show() prints room + " lamp on? " + isOn), give the output:
Lamp a = new Lamp();
Lamp b = new Lamp();
a.room = "Kitchen";
b.room = "Bedroom";
a.switchOn();
a.show();
b.show();
b.switchOn();
a.switchOff();
a.show();
b.show();
Try it first, then show the solutionSolution
- a is switched on; b is still false (default): Kitchen true, Bedroom false.
- b switched on, a switched off: Kitchen false, Bedroom true.
Answer: Kitchen lamp on? true
Bedroom lamp on? false
Kitchen lamp on? false
Bedroom lamp on? true
Example 4: Two references, one object · 2 marks · Short answerHOTS / competency
Give the output (tick() adds 1 to count):
Counter c1 = new Counter();
Counter c2 = new Counter();
c1.tick();
c1.tick();
c2.tick();
Counter c3 = c1;
c3.tick();
System.out.println(c1.count + " " + c2.count + " " + c3.count);
Try it first, then show the solutionSolution
- After three ticks: c1.count = 2, c2.count = 1.
- c3 = c1 refers to the same object; c3.tick() makes it 3, seen through both c1 and c3.
Answer: 3 1 3
Example 5: Attributes and behaviour of a bank account · 2 marks · Very short answerExam level
Model a bank account as an object: give three attributes with suitable data types and two methods.
Try it first, then show the solutionSolution
- Attributes: String holderName; long accountNumber; double balance.
- Methods: deposit(double amount), withdraw(double amount) (or showBalance()).
Answer: Attributes: String holderName, long accountNumber, double balance. Methods: deposit(double amount) and withdraw(double amount).
Example 6: Message passing in a statement · 2 marks · Very short answerHarder exam level
In System.out.println("Hello"); identify the object, the message (method) and the argument. Why is this an example of message passing?
Try it first, then show the solutionSolution
- Object: System.out (the standard output stream); method: println; argument: "Hello".
- The program asks the System.out object to perform println with the given information: a method call on an object.
Answer: Object: System.out; message: println; argument: "Hello". It is message passing because the program sends the println request with data to the System.out object, which carries out the printing.
Example 7: PiggyBank program · 15 marks · Long answerHarder exam level
Define a class PiggyBank with data members owner (String) and coins (int) and methods:
void addCoins(int n): adds n to coins
void spend(int n): subtracts n if enough coins, otherwise prints "Not enough coins for " + owner
void display(): prints owner + " has " + coins + " coins"
In main(), create two objects for Riya and Kabir, add 50 and 20 coins, make Riya spend 15 and Kabir spend 30, and display both.
Try it first, then show the solutionSolution
- class PiggyBank
{
String owner;
int coins; - void addCoins(int n)
{
coins = coins + n;
}
void spend(int n)
{
if (n <= coins)
coins = coins - n;
else
System.out.println("Not enough coins for " + owner);
}
void display()
{
System.out.println(owner + " has " + coins + " coins");
} - public static void main(String args[])
{
PiggyBank p = new PiggyBank();
PiggyBank q = new PiggyBank();
p.owner = "Riya";
q.owner = "Kabir";
p.addCoins(50);
q.addCoins(20);
p.spend(15);
q.spend(30);
p.display();
q.display();
}
} - Trace: Riya 0 + 50 − 15 = 35. Kabir 0 + 20 = 20; spend(30) is refused because 30 > 20, so the message is printed and coins stay 20. (if-else is studied in Conditional Statements.)
Answer: Output (as run):
Not enough coins for Kabir
Riya has 35 coins
Kabir has 20 coins
Case-study practice (Section B style)
Read the situation, then answer every part. In a school exam set on the board pattern this is a 7-mark question split into 2 + 2 + 3 marks.
Modelling a school library
Imagine a school library system with a class Book (title, author, isIssued) and a class Member (name, booksHeld). When a member borrows a book, the program calls member.borrow(book), which calls book.issue(). The librarian creates 3,000 Book objects from the single Book class.
(i) · 2 marks
Give two data members and two methods suitable for the class Book.
Answer
Answer: Data members: String title, boolean isIssued (or author). Methods: issue(), returnBook() (or show()).
1 mark each pair.
(ii) · 2 marks
Which view of a class is shown when 3,000 Book objects are made from one class? Explain.
Answer
Answer: The class as an object factory (and blueprint): one class definition produces many similar objects, each with its own title, author and isIssued values.
1 mark view, 1 mark explanation.
(iii) · 3 marks
Explain member.borrow(book) followed by book.issue() as message passing.
Answer
Answer: The program sends the message borrow, with the book as argument, to the object member. To carry it out, member sends the message issue() to the object book, which changes its own state isIssued to true. Objects cooperate by calling each other's methods, and each changes only its own data.
1 mark each for: first message, second message, each object changing its own state.
Where the marks are
How a typical answer is split into step marks. Show every step: a right final answer alone rarely earns full marks.
Distinguish between a class and an object. (2 marks) (2 marks)
| Step | Marks |
|---|---|
| Class: blueprint or template; logical; no object memory on declaration. | 1 |
| Object: instance of a class with its own values; created by new in memory. | 1 |
Program: class PiggyBank with data members, three methods and main() creating two objects. (15 marks) (15 marks)
| Step | Marks |
|---|---|
| Class header and data members with correct types. | 3 |
| addCoins() and spend() changing coins correctly (with the check). | 4 |
| display() with the required message. | 2 |
| main(): two objects with new and owners set. | 3 |
| Method calls through the dot operator in the required order. | 3 |
Where students lose marks in Elementary Concept of Objects and Classes
The slips examiners see most often, and what to write instead.
Mistake: Calling a method without an object
Forgetting that methods belong to objects.
Wrong working
switchOn(); inside main() of another class
Right working
a.switchOn();
Do this: Create the object with new and use objectName.method().
Usually costs: 1 to 2 marks.
Mistake: Forgetting new
Declaring is mistaken for creating.
Wrong working
Lamp a; a.switchOn();
Right working
Lamp a = new Lamp(); a.switchOn();
Do this: A declaration only makes a reference; new makes the object.
Usually costs: 1 to 2 marks.
Mistake: Mixing up attributes and behaviours
Verbs and nouns confused.
Do this: Attributes are things an object has (nouns); behaviours are things it does (verbs).
Usually costs: 1 mark.
Mistake: Assuming s2 = s1 copies the object
Thinking of primitive variables.
Do this: It copies the reference; both names refer to one object.
Usually costs: 1 to 2 marks in output questions.
Practice questions on Elementary Concept of Objects and Classes
Write each answer on paper first. Open the hint only if you are stuck, and the answer only when you have finished.
Q1 · 1 mark · MCQExam level
An object is an ______ of a class.
(a) attribute
(b) instance
(c) method
(d) keywordHint
Example made from the plan.
Answer
(b) instance
Q2 · 1 mark · MCQExam level
The operator used to call a method of an object is:
(a) new
(b) =
(c) . (dot)
(d) ;Hint
obj.method()
Answer
(c) . (dot)
Q3 · 1 mark · Very short answerHarder exam level
Which of the following is a class and which are objects: Animal, Tiger in Ranthambore, Your pet dog Bruno?
Hint
General vs particular.
Answer
Animal is a class; a particular tiger in Ranthambore and the pet dog Bruno are objects (instances).
Q4 · 2 marks · Very short answerExam level
Why is a class called an object factory?
Hint
Many similar objects.
Answer
Because, like a factory producing many similar items from one design, a class can produce any number of objects with the same attributes and methods, each with its own values, using new.
Q5 · 2 marks · Very short answerHarder exam level
Write a statement to create an object m of class MobilePhone and call its method charge() with the argument 30.
Hint
new, then dot.
Answer
MobilePhone m = new MobilePhone();
m.charge(30);Q6 · 2 marks · Very short answerHarder exam level
What value does an int data member have if an object is created and nothing is assigned to it? What about a boolean data member?
Hint
Default values.
Answer
An int data member is 0 and a boolean data member is false by default.
Q7 · 2 marks · Short answerHOTS / competency
Two objects s1 and s2 of class Student are created. s1.marks = 80; s2 = s1; s2.marks = 95; What is s1.marks now? Explain.
Hint
Reference copy.
Answer
95. After s2 = s1, both names refer to the same object, so setting s2.marks to 95 changes the marks seen through s1 too.
Q8 · 15 marks · Long answerHarder exam level
Define a class Fan with data members speed (int) and isOn (boolean) and methods switchOn(), setSpeed(int s) and show(). In main(), create a fan, switch it on, set its speed to 3 and show it.
Hint
Same pattern as Lamp.
Answer
class Fan
{
int speed;
boolean isOn;
void switchOn()
{
isOn = true;
}
void setSpeed(int s)
{
speed = s;
}
void show()
{
System.out.println("On: " + isOn + ", speed: " + speed);
}
public static void main(String args[])
{
Fan f = new Fan();
f.switchOn();
f.setSpeed(3);
f.show();
}
}
Output (as run): On: true, speed: 3Q9 · 3 marks · Short answerHOTS / competency
A game has a class Player. 'Every player has a name and a score, and can jump and collect coins.' Explain how this sentence helps you design the class, and why the score of one player does not affect another's.
Hint
Nouns and verbs.
Answer
The nouns describing a player (name, score) become data members, and the verbs (jump, collect coins) become methods such as jump() and collectCoins(). Each Player object created with new gets its own copy of name and score, so collecting coins changes only that object's score.
Test your recall
Answer in your head or on paper first, then open the card. Pulling an answer out of memory makes it stick far better than re-reading.
1.What are the two parts of an object's description?Show answer
State (data members) and behaviour (methods).
2.Operator that allocates memory for an object?Show answer
new
3.A class used to declare variables is a ______ data type.Show answer
User-defined.
4.Calling a method of an object is called?Show answer
Message passing.
5.Default value of a boolean data member?Show answer
false
Best order to study it
- Learn objects as entities with state, behaviour and identity.
- Learn the class as blueprint, factory and user-defined type.
- Practise creating objects with new and calling methods with the dot operator.
- Learn message passing with real-life and Java examples.
- Trace programs with several objects; then write a full class with main().
Quick revision checklist
The night before the exam: can you do each of these without looking?
- Object: state (data members) + behaviour (methods) + identity.
- Class: blueprint, object factory, user-defined data type.
- ClassName obj = new ClassName(); members via obj.member.
- Message passing: obj.method(arguments).
- Each object has its own copy of data; copying a reference shares one object.
Elementary Concept of Objects and Classes: frequently asked questions
Is main() a method of the class?
Yes. main() is where execution begins. It can be written inside the same class, as in this guide, and creates objects of the class to use.
Do I need private and public in Class IX?
Access specifiers belong to the Class X topic of encapsulation. In Class IX, focus on data members, methods, creating objects and calling methods.
Is String a class?
Yes. String is a class supplied by Java, so a String variable refers to an object, unlike int or double, which are primitive types.
Based on: CISCE ICSE 2028 Computer Applications (86) syllabus (Classes IX and X); CISCE Regulations for ICSE Examination Year 2028