ICSE Class 10 · Computer Applications (Java) · Objects and classes 2027

Class as the basis of all computation, explained for ICSE Class 10.

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

Courses built on objects and classes

Classes are the spine of the ICSE BlueJ course, the whole of ISC Computer Science, and every data structure a programmer meets later.

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?

Why is class called the basis of all computation? Definitions in one sentence

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.

TermOne-sentence definition
ObjectAn entity that has a state, the values of its characteristics, and a behaviour, the actions it can perform.
StateThe data an object holds at a moment, stored in its data members (member variables).
BehaviourWhat an object can do, written as the member methods of its class.
ClassA blueprint or template that declares the data members and member methods shared by a set of similar objects.
Class as an object factoryA class can produce any number of objects of the same kind, each with its own state, using new.
InstanceAn object is called an instance of its class, because it is one concrete example of that blueprint.
Class as an abstractionA class keeps only the features of an object that matter to the program and leaves out the rest.
User defined data typeA class is a data type the programmer creates, so variables of that class type can be declared just like int variables.
new operatorAllocates memory for a new object and returns a reference to it, which is stored in a variable of the class type.

Objects and classes ICSE: real-life examples

ClassOne object of itState (data members)Behaviour (methods)
CeilingFanThe fan in your bedroomspeed, isOnswitchOn(), changeSpeed()
TrainTonight's express to Delhinumber, coaches, currentStationdepart(), reachStation()
LibraryBookYour copy of a noveltitle, author, issuedissue(), returnBook()
WaterTankThe tank on your roofcapacity, levelfill(), 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?

Class as user defined data type: primitive against composite types

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.

PointPrimitive data typeComposite (class) type
Who defines itBuilt into JavaCreated by the programmer, or supplied in a library
Examplesint, double, char, boolean and four moreWaterTank, Batsman, String, Scanner
What a variable holdsThe value itselfA reference to an object
How many valuesExactly oneSeveral data members, plus methods
SizeFixed (an int is 4 bytes)Depends on the members declared
Creating a valueint n = 5;WaterTank t = new WaterTank(500);
Default value as a member0, 0.0, false or the character with code 0null until an object is assigned
Value against referencerun in Java 21
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?".

Why not every class is treated as a data type

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.

Declaring variables of a class type

  1. WaterTank roof; declares a reference; no tank exists yet.
  2. roof = new WaterTank(1000); creates the object and stores its reference.
  3. 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?

Instance variables vs class variables ICSE, with outputs

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.

KindDeclaredCopiesLives as long asExample
Instance variableIn the class, outside methods, no staticOne per objectThe objectint level;
Class variableIn the class, outside methods, with staticOne for the whole classThe program runstatic int tanks;
Argument (parameter) variableIn a method's bracketsOne per callThat callvoid fill(int litres)
Local variableInside a method or blockOne per callThat method or blockdouble pct in display()
One shared, one eachrun in Java 21
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.

Statementx.wattsy.wattsBulb.made
Startnonenone0
x = new Bulb(9)9none1
y = new Bulb(12)9122
x.watts = 1515122

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?

Design a class: from question text to finished program

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.

  1. Name the class

    Use the name the question gives, with a capital first letter. If none is given, choose a singular noun: Batsman, not Batsmen.

  2. List the data members

    One line per member, with its type and a short comment. Mark shared totals or counters static.

  3. Write the constructor

    Set every member to a sensible start: 0, 0.0, an empty String, or the value passed in.

  4. Write one method per task

    Input, calculation and display are kept separate, with the method names and return types the question states.

  5. Write main last

    Create the object or objects with new and call the methods in the order the task needs.

  6. Add the variable description table

    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.

WaterTank.javainstance and class variables
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.

VariableTypePurpose
capacity, levelintinstance variables: size and contents of one tank
tanksstatic intclass variable: number of tanks created
capintconstructor parameter: capacity
litresintparameter of fill and use
pctdoublelocal: percentage full
a, bWaterTankthe two tank objects
scScannerreads the inputs
Sample runJava 21
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.

Batsman.javathree objects, one shared 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.

VariableTypePurpose
nameStringinstance: player's name
runs, ballsintinstance: runs scored and balls faced
teamRunsstatic intclass variable: total runs of all players
scScannerkeyboard reader, passed to accept
p1, p2, p3Batsmanthe three player objects
Sample runJava 21
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?

Objects and classes ICSE questions with answers

Original questions in the one-mark and two-mark shapes of Section A. Commit to an answer before you open it.

  1. An object's state is stored in its
    Answer Data members (member variables).
  2. Which keyword makes a data member a class variable?
    Answer static.
  3. Why is a class called an object factory?
    Answer Because any number of objects of the same kind can be produced from one class with new, each with its own state.
  4. Name the operator that allocates memory for an object.
    Answer new.
  5. Is String a primitive type or a composite type?
    Answer Composite. It is a class in java.lang, so a String variable holds a reference to an object.
  6. Give the output: 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.
    Answer 2. One shared counter, increased once by each constructor call.
  1. Why is a class known as a user defined data type?
    Answer Because the programmer creates it, and after that, variables of the class type can be declared and objects of it created, just as variables of a built-in type are.
  2. State two differences between instance variables and class variables.
    Answer An instance variable is declared without static and each object has its own copy; a class variable is declared static and one copy is shared by all objects. An instance variable is used through an object; a class variable can be used through the class name.
  3. Identify the state and behaviour of a ceiling fan as a Java object.
    Answer State: speed and whether it is on. Behaviour: switching on or off and changing the speed.
  4. Differentiate between a primitive data type and a composite data type.
    Answer A primitive type is built into Java and its variable holds one value directly, such as int. A composite type is made from a class, can hold several members, and its variable holds a reference to an object.
  5. Write one statement that declares a reference t of class Train and creates an object using a constructor that takes a train number.
    Answer 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?

How the evening group learns to think in classes

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.

Objects from the room

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.

References traced

Short fragments with shared static counters and copied references are traced in a table, then run in BlueJ so nobody argues about the result.

Nouns and verbs

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.

Written, then marked

On Wednesday evening the class is written by hand with its variable description table and marked against the scheme, part by part.

Kept for the lab file

The finished design goes into the student's laboratory assignments, which count towards internal assessment.

Back in the mocks

Class design returns in every full mock paper from December, under the full two-hour clock.

Batch or personalised: you choose

Learn objects and classes in a small group, or privately

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

Mini batch, Tuesday 5:30 PM and Wednesday 8 PM

₹2,999

per month, two live classes a week

  • Live on Tuesday 5:30 PM and Wednesday 8:00 PM IST
  • At most six students in the group
  • A new Section B class designed each fortnight
  • Nouns-to-members method practised on screen
  • Shared static and reference traps run in BlueJ
Book a free demo in this batch

Option 2 · Choose your own timing

Personalised one to one

₹4,999

per month, one private class a week, at a time set with you

  • Lessons at an hour your family chooses
  • Slower or faster, matched to your child
  • Class designs drawn up together, then solo
  • ISC-style classes added for a stronger student
  • Same mentors and same marking as the group
Ask for a personalised plan

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?

Objects and classes lessons for ICSE students overseas

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 liveTime differenceUsual class window, local timeFormat
India (IST)
every Indian city
ISTTue 5:30 PM, Wed 8:00 PMMini batch or 1-on-1
United Arab Emirates
Dubai, Sharjah
1 h 30 min behind India3:00 PM to 9:00 PMPersonalised 1-on-1
Indonesia and Thailand
West Java, Bangkok area
1 h 30 min ahead of India3:30 PM to 9:00 PMPersonalised 1-on-1
Singapore
Singapore
2 h 30 min ahead of India3:30 PM to 9:00 PMPersonalised 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

Rated 4.9 across 547 Google reviews

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

More pages for Class 10 board students

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

What students ask about class as the basis of all computation

Why is class called the basis of all computation in Java?

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.

What is an object in ICSE Class 10?

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.

What is a class in Java for ICSE?

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.

Why is a class called an object factory?

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.

Why is a class known as a user defined data type?

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.

What is the difference between instance variables and class variables?

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.

What is the difference between primitive and composite data types?

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.

Is this chapter asked in Section B of the ICSE paper?

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.

Where do instance and class variables come in the ICSE syllabus?

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.

Do you teach objects and classes in live classes?

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

Book a free demo on objects and classes

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.

We call within a few hours. No card, no enrolment fee.

Want it sooner? Book a priority demo

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

Keep exploring Modern Age Coders

By class and age

Learn more

Free resources

From the blog

Start here