★★★★★
"The one step solution for my son. Modern Age Coders make learning coding so simple that kids love it. The teachers explain complex concepts clearly with practical exercises and interactive content."
Ria Mukherjee
Parent
ICSE Class 10 · Computer Applications (Java) · Objects and classes 2027
Class as the basis of all computation is the first new chapter of ICSE Class 10 Computer Applications, and every Section B answer rests on it: no class, no program. The idea is simple. A Java program is built from classes, and every value it works on either is a primitive or lives inside an object made from a class. This page gives the definitions the examiner wants, the primitive against composite table, instance against class variables with outputs from Java 21, and a walkthrough that turns a Section B question into a finished class. In our live mini batch students practise exactly that turn, from question text to running code.
Live online · board definitions · instance vs class variables, run · design-a-class walkthrough · two programs · first class free
Start here
Classes are the spine of the ICSE BlueJ course, the whole of ISC Computer Science, and every data structure a programmer meets later.

The batch / ICSE CA
The Class 9 and 10 course, in a group of six at most, where each fortnight a Section B question is turned into a designed class.
Open the course →
Next step / ISC
ISC questions hand you a class diagram and expect objects to be passed, compared and returned; this chapter is the start of that road.
Open the course →
Beyond the syllabus / DSA
Stacks, queues and linked lists are just classes whose objects point at each other. A natural next step for a curious student.
Open the course →Ans. The short version
Class as the basis of all computation means that every Java program is written as one or more classes, and all data and work happen inside them. An object is an entity with state (its data members) and behaviour (its member methods). A class is the blueprint that describes such objects, so it works as an object factory. Because the programmer creates it, a class is a user defined, composite data type. Instance variables get a copy in each object; a static class variable is shared. Modern Age Coders teaches this live in a Tuesday and Wednesday mini batch in India, or one to one.
Q1. Why is a class called the basis of all computation?
A class is called the basis of all computation because in Java every program is written inside a class, and every piece of data the program works on belongs either to a primitive variable or to an object built from a class. These are the definitions the chapter asks for, one sentence each.
| Term | One-sentence definition |
|---|---|
| Object | An entity that has a state, the values of its characteristics, and a behaviour, the actions it can perform. |
| State | The data an object holds at a moment, stored in its data members (member variables). |
| Behaviour | What an object can do, written as the member methods of its class. |
| Class | A blueprint or template that declares the data members and member methods shared by a set of similar objects. |
| Class as an object factory | A class can produce any number of objects of the same kind, each with its own state, using new. |
| Instance | An object is called an instance of its class, because it is one concrete example of that blueprint. |
| Class as an abstraction | A class keeps only the features of an object that matter to the program and leaves out the rest. |
| User defined data type | A class is a data type the programmer creates, so variables of that class type can be declared just like int variables. |
new operator | Allocates memory for a new object and returns a reference to it, which is stored in a variable of the class type. |
| Class | One object of it | State (data members) | Behaviour (methods) |
|---|---|---|---|
| CeilingFan | The fan in your bedroom | speed, isOn | switchOn(), changeSpeed() |
| Train | Tonight's express to Delhi | number, coaches, currentStation | depart(), reachStation() |
| LibraryBook | Your copy of a novel | title, author, issued | issue(), returnBook() |
| WaterTank | The tank on your roof | capacity, level | fill(), use() |
The constructor, the special method that sets an object's starting state, has its own chapter: constructors ICSE Class 10 questions.
Q2. Why is a class a user defined data type?
A class is a user defined data type because the programmer creates it, and once it exists, variables of that type can be declared and objects of it created. It is composite because one object bundles several values, possibly of different types, together with the methods that use them.
| Point | Primitive data type | Composite (class) type |
|---|---|---|
| Who defines it | Built into Java | Created by the programmer, or supplied in a library |
| Examples | int, double, char, boolean and four more | WaterTank, Batsman, String, Scanner |
| What a variable holds | The value itself | A reference to an object |
| How many values | Exactly one | Several data members, plus methods |
| Size | Fixed (an int is 4 bytes) | Depends on the members declared |
| Creating a value | int n = 5; | WaterTank t = new WaterTank(500); |
| Default value as a member | 0, 0.0, false or the character with code 0 | null until an object is assigned |
int p = 5; int q = p; // q gets a copy of 5 q = 8; System.out.println(p + " " + q); Mug m1 = new Mug(); Mug m2 = m1; // m2 refers to the same mug m2.ml = 250; System.out.println(m1.ml); Mug m3 = new Mug(); Mug m4 = new Mug(); m3.ml = 300; m4.ml = 300; System.out.println((m3 == m4) + " " + (m3.ml == m4.ml)); // Output 5 8 250 false true
Copying a primitive copies the value. Copying a class variable copies only the reference, so both names reach one object. == on two objects asks "same object?", not "same contents?".
A class written only to hold main and run a task is used as a program, not as a type. A class such as WaterTank, from which other code declares variables and creates objects, is the one that behaves as a user defined data type. Examiners accept either view if it is explained in a sentence.
WaterTank roof; declares a reference; no tank exists yet.roof = new WaterTank(1000); creates the object and stores its reference.WaterTank sump = new WaterTank(2000); does both in one line.Primitive types, their sizes and how values are read with Scanner are covered on data types and input in Java for ICSE Class 10, and the wrapper class for each primitive is on wrapper and library classes.
Q3. What is the difference between instance variables and class variables?
An instance variable is a data member declared without static, so every object gets its own copy; a class variable is declared static, so one copy is shared by all objects of the class. The syllabus lists these, together with argument and local variables, under the scope of variables in the Encapsulation chapter, and they are asked alongside this one.
| Kind | Declared | Copies | Lives as long as | Example |
|---|---|---|---|---|
| Instance variable | In the class, outside methods, no static | One per object | The object | int level; |
| Class variable | In the class, outside methods, with static | One for the whole class | The program run | static int tanks; |
| Argument (parameter) variable | In a method's brackets | One per call | That call | void fill(int litres) |
| Local variable | Inside a method or block | One per call | That method or block | double pct in display() |
class Bulb {
int watts; // instance variable
static int made = 0; // class variable
Bulb(int w) {
watts = w;
made++;
}
}
// in main:
Bulb x = new Bulb(9);
Bulb y = new Bulb(12);
x.watts = 15;
System.out.println(x.watts + " " + y.watts + " "
+ Bulb.made + " " + x.made);
// Output: 15 12 2 2
Changing x.watts leaves y.watts alone. Both constructors added to the single made, so it reads 2 through the class name and through x.
| Statement | x.watts | y.watts | Bulb.made |
|---|---|---|---|
| Start | none | none | 0 |
x = new Bulb(9) | 9 | none | 1 |
y = new Bulb(12) | 9 | 12 | 2 |
x.watts = 15 | 15 | 12 | 2 |
Access specifiers and the full scope rules are on encapsulation and access specifiers; short answers that compare two terms in a table are collected on ICSE Computer Applications difference between questions.
Q4. How do you turn a Section B question into a class?
Read the question twice and pull out its nouns and its verbs: the nouns that describe one thing become data members, the verbs become methods, and anything counted across all objects becomes a static member. Then write the parts in a fixed order.
Use the name the question gives, with a capital first letter. If none is given, choose a singular noun: Batsman, not Batsmen.
One line per member, with its type and a short comment. Mark shared totals or counters static.
Set every member to a sensible start: 0, 0.0, an empty String, or the value passed in.
Input, calculation and display are kept separate, with the method names and return types the question states.
Create the object or objects with new and call the methods in the order the task needs.
Every variable, its type and its purpose. Section B asks for variable descriptions, and they carry marks in internal assessment too.
Question 1. Define a class WaterTank with instance variables capacity and level (int) and a class variable tanks (int) that counts how many tanks have been created. Write a constructor WaterTank(int cap), void fill(int litres) that reports and removes any overflow, void use(int litres) that refuses to draw more than the tank holds, and void display() showing the level and the percentage full. In main, read the capacities and amounts with Scanner and use two tanks.
import java.util.Scanner;
class WaterTank {
int capacity; // instance variable: litres the tank holds
int level; // instance variable: litres in it now
static int tanks = 0; // class variable: tanks made so far
WaterTank(int cap) {
capacity = cap;
level = 0;
tanks++;
}
void fill(int litres) {
level = level + litres;
if (level > capacity) {
System.out.println("Overflow of " + (level - capacity) + " litres");
level = capacity;
}
}
void use(int litres) {
if (litres > level)
System.out.println("Only " + level + " litres available");
else
level = level - litres;
}
void display() {
double pct = level * 100.0 / capacity;
System.out.println(level + " of " + capacity + " litres (" + pct + "%)");
}
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
System.out.print("Capacity of tank A and tank B: ");
WaterTank a = new WaterTank(sc.nextInt());
WaterTank b = new WaterTank(sc.nextInt());
System.out.print("Litres to pour into A, then into B: ");
a.fill(sc.nextInt());
b.fill(sc.nextInt());
System.out.print("Litres to draw from A: ");
a.use(sc.nextInt());
a.display();
b.display();
System.out.println("Tanks created: " + WaterTank.tanks);
}
}
Each tank keeps its own level, but tanks is one counter for the class, read through the class name in main. Multiplying by 100.0 makes the percentage a double.
| Variable | Type | Purpose |
|---|---|---|
| capacity, level | int | instance variables: size and contents of one tank |
| tanks | static int | class variable: number of tanks created |
| cap | int | constructor parameter: capacity |
| litres | int | parameter of fill and use |
| pct | double | local: percentage full |
| a, b | WaterTank | the two tank objects |
| sc | Scanner | reads the inputs |
Capacity of tank A and tank B: 500 800 Litres to pour into A, then into B: 620 300 Overflow of 120 litres Litres to draw from A: 150 350 of 500 litres (70.0%) 300 of 800 litres (37.5%) Tanks created: 2
Tank A takes 620, overflows by 120 and is capped at 500; drawing 150 leaves 350, which is 70 per cent.
Question 2. Define a class Batsman with instance variables name (String), runs and balls (int), and a class variable teamRuns (int) holding the total of all batsmen's runs. Write a default constructor, void accept(Scanner sc) to read one player's details and add the runs to teamRuns, double strikeRate() that returns runs per 100 balls to two decimal places (0 if no ball was faced), and void display(). In main, create three batsmen, display them in a table and print the team total.
import java.util.Scanner;
class Batsman {
String name; // instance: player's name
int runs; // instance: runs scored
int balls; // instance: balls faced
static int teamRuns = 0; // class variable: shared by all players
Batsman() {
name = "";
runs = 0;
balls = 0;
}
void accept(Scanner sc) {
System.out.print("Name, runs and balls: ");
name = sc.next();
runs = sc.nextInt();
balls = sc.nextInt();
teamRuns = teamRuns + runs;
}
double strikeRate() {
if (balls == 0)
return 0.0;
return Math.round(runs * 10000.0 / balls) / 100.0;
}
void display() {
System.out.println(name + "\t" + runs + "\t" + balls + "\t" + strikeRate());
}
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
Batsman p1 = new Batsman();
Batsman p2 = new Batsman();
Batsman p3 = new Batsman();
p1.accept(sc);
p2.accept(sc);
p3.accept(sc);
System.out.println("Name\tRuns\tBalls\tStrike rate");
p1.display();
p2.display();
p3.display();
System.out.println("Team total = " + Batsman.teamRuns);
}
}
One Scanner is made in main and passed to accept, so all three objects read from the same keyboard. A method that returns a value (strikeRate) is called inside display.
| Variable | Type | Purpose |
|---|---|---|
| name | String | instance: player's name |
| runs, balls | int | instance: runs scored and balls faced |
| teamRuns | static int | class variable: total runs of all players |
| sc | Scanner | keyboard reader, passed to accept |
| p1, p2, p3 | Batsman | the three player objects |
Name, runs and balls: Rohan 47 38 Name, runs and balls: Anaya 82 51 Name, runs and balls: Vikram 9 14 Name Runs Balls Strike rate Rohan 47 38 123.68 Anaya 82 51 160.78 Vikram 9 14 64.29 Team total = 138
47 x 100 / 38 is 123.684..., rounded to 123.68. The tabs are shown as spaces here. 47 + 82 + 9 is 138, collected in the one shared teamRuns.
The same design steps drive bill and tariff questions: see ICSE Class 10 slab and bill programs.
Q5. What questions come from this chapter in Section A?
Original questions in the one-mark and two-mark shapes of Section A. Commit to an answer before you open it.
String a primitive type or a composite type?
Bulb x = new Bulb(9); Bulb y = new Bulb(12); then System.out.println(Bulb.made); where the constructor does made++ on a static made starting at 0.
t of class Train and creates an object using a constructor that takes a train number.
Train t = new Train(12301);Questions of this kind across the whole syllabus are on ICSE Computer Applications important questions.
Q6. How is this chapter taught live?
Most students can recite "a class is a blueprint" and still freeze when a Section B question names a class they have never seen. The classes aim at that gap, so the definitions turn into a design habit.
On Tuesday evening each student picks an object near them and names its state and behaviour aloud; the group decides which features a program would keep.
Short fragments with shared static counters and copied references are traced in a table, then run in BlueJ so nobody argues about the result.
A fresh Section B question is marked up on screen, nouns circled for members and verbs underlined for methods, before a line of code is written.
On Wednesday evening the class is written by hand with its variable description table and marked against the scheme, part by part.
The finished design goes into the student's laboratory assignments, which count towards internal assessment.
Class design returns in every full mock paper from December, under the full two-hour clock.
Batch or personalised: you choose
The definitions, the traces and the class designs are identical either way. Within India the choice is the two-evening group of six or private lessons at your hour; ICSE families abroad always get private lessons. Monthly billing, no admission fee.
Option 1 · Fixed batch timings
₹2,999
per month, two live classes a week
Option 2 · Choose your own timing
₹4,999
per month, one private class a weektwo private classes a week, at a time set with you
Outside India: the ICSE Computer Applications course runs as personalised one to one, two private classes a week at a time set in your own time zone. The mini batch is taught for families in India.
A child who knows the definitions but cannot start a Section B class usually gains most from a few private lessons on the design steps. A child who needs steady practice of every chapter will get more from the twice-weekly group. Fees on this page show in your currency.
Studying outside India?
Outside India, ICSE students sit the identical Computer Applications paper, and this chapter underpins every program in it. Lessons abroad are private and timed for the end of the local school day.
| Where you live | Time difference | Usual class window, local time | Format |
|---|---|---|---|
| India (IST) every Indian city | IST | Tue 5:30 PM, Wed 8:00 PM | Mini batch or 1-on-1 |
| United Arab Emirates Dubai, Sharjah | 1 h 30 min behind India | 3:00 PM to 9:00 PM | Personalised 1-on-1 |
| Indonesia and Thailand West Java, Bangkok area | 1 h 30 min ahead of India | 3:30 PM to 9:00 PM | Personalised 1-on-1 |
| Singapore Singapore | 2 h 30 min ahead of India | 3:30 PM to 9:00 PM | Personalised 1-on-1 |
After the free demo we agree a fixed slot, and it can move in a test week. The overseas arrangement is described on ICSE Computer Applications classes in the Gulf and abroad.
What families say
Real reviews from real families. We neither write nor commission them.
★★★★★
"The one step solution for my son. Modern Age Coders make learning coding so simple that kids love it. The teachers explain complex concepts clearly with practical exercises and interactive content."
Ria Mukherjee
Parent
★★★★★
"Modern Age Coders has been a game-changer for me. I struggled to grasp IT concepts and coding before joining, but their classes transformed everything. I can now confidently write complex programs with ease."
Samriddha Mondal
Student
★★★★★
"One of the most wonderful education centres out there. Education is not limited to school syllabus but focuses on skill development."
Vansh Agarwal
Student
★★★★★
"My child Dhairya is really enjoying the Modern Age Coders classes. This is his first online class and he eagerly looks forward to it. I can already see his improvement, and the teachers are very cooperative."
Sonam Oswal
Parent of Dhairya
★★★★★
"Modern Age Coders have wonderful teachers who teach in a clear, easy and practical way. The teacher boosts students' confidence and inspires them to learn without hesitation."
Sonu Goyal
Parent
★★★★★
"I highly recommend this computer coding class! The teachers are incredibly knowledgeable and passionate about coding."
Ritu Kedia
Parent
The rest of the Class 10 series
Every page in the ICSE Class 10 Computer Applications series, grouped by what you need: classes, each chapter, Section B programs, question practice, notes and revision, and the exam itself.
CBSE Class 10 AI (417): The Mon and Wed 9 PM AI batch CBSE AI 417 syllabus explained CBSE AI important questions Sample paper and mock tests
Questions about classes and objects
Because a Java program cannot exist outside a class. All code is written in classes, and all data either sits in a primitive variable inside a class or is stored in objects created from classes. So every computation a program performs happens within, or on, a class.
An object is an entity with a state and a behaviour. Its state is the set of values in its data members, such as a fan's speed; its behaviour is what it can do, written as member methods, such as changing speed. In Java an object is created from a class with new.
A class is a blueprint or template that declares the data members and member methods common to a group of similar objects. It describes what every object of that kind will have and do, and objects are then created from it.
Because one class can produce as many objects as the program needs, all with the same structure but each with its own state. Every use of new on the class turns out another object, just as a factory turns out products from one design.
Because the programmer defines it, and once defined, it can be used like any other type: variables of the class type are declared and objects are stored in them. It is a composite type, since one object holds several values and the methods that use them.
An instance variable is declared without static, so every object has its own copy. A class variable is declared static, so a single copy is shared by all objects and can be used through the class name. Changing an instance variable affects one object; changing a class variable affects them all.
Primitive types such as int, double, char and boolean are built into Java and hold a single value directly. Composite types are classes, such as String or a class you write; a variable of a composite type holds a reference to an object that may contain many values.
Not as a separate question, but every Section B program is a class, so the chapter is used in all of them. Its definitions and differences are asked directly in Section A, as one-mark and two-mark questions.
The 2026-27 syllabus for the 2027 exam lists class, instance, argument and local variables under the scope of variables in the Encapsulation chapter. Schools usually teach the instance and class distinction alongside objects and classes, as this page does.
Yes. The ICSE group meets on Tuesday at 5:30 PM IST and Wednesday at 8:00 PM IST, with six students at most; definitions are practised aloud and a full class is designed and marked each fortnight. Private one to one lessons are available at a time that suits the family.
Start
In the free demo your child names the state and behaviour of an everyday object, traces a short static-counter fragment, and turns a Section B question into the skeleton of a class with the mentor. You then hear clearly how ready your child is for Section B and which format, group or private, would help most.
Prefer to see the whole subject first? Try the ICSE Computer Applications syllabus explained or the ICSE Class 10 Java classes.
WhatsApp us · +91 91233 66161 · connect@modernagecoders.com
Every class is live video. The form requests a callback and reserves nothing.
A full live class of about 45 to 60 minutes at a slot you pick, with a written skill report and learning roadmap on WhatsApp afterwards. The fee is adjusted against your first month if you enrol.
Book a priority demo