★★★★★
"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) · User-defined methods 2027
Function overloading in ICSE Class 10 means one class with several methods of the same name that differ in their parameters, and it is one of the most predictable Section B questions in Computer Applications. This page covers the whole user-defined methods chapter around it: prototype and signature, pure and impure methods, call by value and call by reference. Three overloading programs are worked in board format and were run in Java 21. In our live mini batch students write these against the clock and are marked on screen.
Live online · three overloading programs, run · which version Java picks · 15-mark checklist · first class free
Start here
Overloading answers are written and marked weekly on our BlueJ course for Classes 9 and 10. After the board, ISC Computer Science splits every program into methods, and a data structures course shows methods with clear inputs and outputs holding larger designs together.

The batch / ICSE CA
Class 9 and 10 Computer Applications in a mini batch, where every overloading answer is ticked against the same seven-point checklist.
Open the course →
Next step / ISC
For students moving to ISC, where whole programs are split into methods that pass values and objects to each other.
Open the course →
Beyond the syllabus / DSA
For the student who wants to see how methods with clear inputs and outputs make larger programs easy to test.
Open the course →Ans. The short version
Function overloading in ICSE Class 10 Computer Applications means defining two or more methods with the same name in one class, each with a different parameter list: a different number of parameters, different types, or a different order of types. Java decides which one to run from the arguments in the call. The return type alone cannot tell overloaded methods apart. Overloading is how the Class 10 syllabus shows polymorphism, and a Section B question often asks for three versions of one method plus a main method that calls them. Modern Age Coders teaches it live in a Tuesday and Wednesday mini batch in India, or one to one.
Q1. What are the parts of a user-defined method?
A user-defined method is a named block of code written by the programmer, which can take values in through parameters and send one value back with return. Its first line is the prototype; its name with the parameter types is the signature.
// prototype (method header):
public double area(double l, double b)
// access return name formal parameters
// specifier type
{
return l * b; // body: sends one value back
}
// signature: area(double, double)
// a call with actual parameters:
double r = ob.area(7.5, 4);
The prototype includes the return type and the access specifier. The signature does not: it is only the name and the parameter types, in order. That difference is exactly why overloading cannot rely on return type.
| Term | Plain meaning | In the example |
|---|---|---|
| Method prototype | The first line of a method: access, return type, name, parameter list | public double area(double l, double b) |
| Method signature | The name and the types of the parameters, in order | area(double, double) |
| Formal parameters | Variables in the header that receive values | l, b |
| Actual parameters | Values written in the call | 7.5, 4 |
| Return type | Type of the value sent back, or void for none | double |
| Static method | Belongs to the class; called without an object | Math.sqrt(16) |
| Non-static method | Belongs to each object; called through an object | ob.area(7.5, 4) |
Methods live inside a class, so this chapter leans on the one before it: class as the basis of all computation. Access specifiers such as public and private are covered on encapsulation and access specifiers.
Q2. What does an overloading answer look like?
An overloading question names the class, names the method and describes each version. The answer is the class with every version written exactly as described, plus a main method that creates an object and calls each one. Below are three original questions in that shape, each with a full answer that was run.
Question A. Design a class Compute to overload a method work() as follows. (i) void work(int n): print the sum of the digits of n. (ii) void work(int a, int b): print the highest common factor of a and b. (iii) void work(String s): print the number of vowels in s. Write a main method to create an object and call all three.
class Compute {
// sum of the digits of n
void work(int n) {
int sum = 0;
while (n > 0) {
sum += n % 10;
n /= 10;
}
System.out.println("Digit sum = " + sum);
}
// highest common factor of a and b
void work(int a, int b) {
while (b != 0) {
int r = a % b;
a = b;
b = r;
}
System.out.println("HCF = " + a);
}
// number of vowels in s
void work(String s) {
int v = 0;
s = s.toUpperCase();
for (int i = 0; i < s.length(); i++) {
char ch = s.charAt(i);
if ("AEIOU".indexOf(ch) != -1)
v++;
}
System.out.println("Vowels = " + v);
}
public static void main(String[] args) {
Compute ob = new Compute();
ob.work(4072);
ob.work(84, 36);
ob.work("Overloading");
}
}
Digit sum = 13 HCF = 12 Vowels = 5
4 + 0 + 7 + 2 is 13. The HCF loop is Euclid's method: 84 and 36, then 36 and 12, then 12 and 0. "Overloading" has O, e, o, a and i.
| Call | Arguments | Version run |
|---|---|---|
ob.work(4072) | one int | work(int) |
ob.work(84, 36) | two ints | work(int, int) |
ob.work("Overloading") | one String | work(String) |
Question B. Design a class Area with three overloaded methods double area(...): one parameter r returns the area of a circle (take pi as 3.14); two parameters return the area of a rectangle; three sides a, b, c return the area of a triangle by Heron's formula. Print each result from main.
class Area {
double area(double r) {
return 3.14 * r * r;
}
double area(double l, double b) {
return l * b;
}
double area(double a, double b, double c) {
double s = (a + b + c) / 2;
return Math.sqrt(s * (s - a) * (s - b) * (s - c));
}
public static void main(String[] args) {
Area ob = new Area();
System.out.println("Circle: " + ob.area(5));
System.out.println("Rectangle: " + ob.area(7.5, 4));
System.out.println("Triangle: " + ob.area(13, 14, 15));
}
}
// Output
Circle: 78.5
Rectangle: 30.0
Triangle: 84.0
These are pure methods: they return a value and print nothing, so main does the printing. The int 5 is widened to double to match area(double).
// Question C. Overload void sum():
// sum(int n): 1 + 2 + ... + n
// sum(double x, int n): x/1 + x/2 + ... + x/n
class Series {
void sum(int n) {
int s = 0;
for (int i = 1; i <= n; i++)
s += i;
System.out.println("Sum of first " + n + " numbers = " + s);
}
void sum(double x, int n) {
double s = 0;
for (int i = 1; i <= n; i++)
s += x / i;
System.out.println("Series sum = " + s);
}
public static void main(String[] args) {
Series ob = new Series();
ob.sum(10);
ob.sum(6.0, 4);
}
}
// Output
Sum of first 10 numbers = 55
Series sum = 12.5
6/1 + 6/2 + 6/3 + 6/4 = 6 + 3 + 2 + 1.5. Because x is double, x / i is real division.
Overloading questions very often wrap series or string tasks, so practise those bodies on their own as well: series programs in Java and ICSE Class 10 string programs.
Q3. Which overloaded version does Java call?
Java first looks for a version whose parameter types match the arguments exactly. If there is none, it allows a widening conversion, such as char to int or int to double. If two versions fit equally well, the program does not compile.
static void show(int x) { System.out.println("int " + x); }
static void show(double x) { System.out.println("double " + x); }
static void show(String x) { System.out.println("String " + x); }
static void show(int x, double y) { System.out.println("int,double " + (x + y)); }
static void show(double x, int y) { System.out.println("double,int " + (x * y)); }
| Call | Output | Why |
|---|---|---|
show(7) | int 7 | Exact match for int |
show(7.0) | double 7.0 | Exact match for double |
show('A') | int 65 | No char version, so char widens to int, the nearest type |
show(9L) | double 9.0 | A long cannot shrink to int, but it can widen to double |
show(5.0f) | double 5.0 | float widens to double |
show("7") | String 7 | A String argument only fits the String version |
show(2, 3.5) | int,double 5.5 | The order of types picks the version |
show(2.5, 4) | double,int 10.0 | Same two types, other order, other version |
int val(int x) { return x; }
double val(int x) { return x; }
// javac: error: method val(int) is
// already defined in class RetOnly
Both have the signature val(int). A different return type does not make a different method.
static void show(int x, double y) { }
static void show(double x, int y) { }
// ...
show(2, 3);
// javac: error: reference to show is ambiguous
Two ints fit both versions after one widening each, and neither is closer, so Java refuses to pick.
Questions that ask for the output of an overloaded call are traced on ICSE Java output questions, and comparisons such as pure versus impure or static versus non-static are collected on ICSE difference between questions. Constructors can be overloaded with the same rules; that chapter is on ICSE Class 10 constructors questions.
Q4. What are pure and impure methods, and how are values passed?
A pure method returns a result that depends only on its parameters and changes nothing outside itself. An impure method changes something outside itself, such as a data member of the object or an array it was given. The syllabus asks for pass by value with programs, and pass by reference as a definition with an example.
class PureImpure {
int total = 0;
// pure: uses only its parameter, changes nothing outside
int cube(int x) {
return x * x * x;
}
// impure: changes the object's data member
void addScore(int s) {
total = total + s;
}
public static void main(String[] args) {
PureImpure ob = new PureImpure();
System.out.println(ob.cube(3) + " " + ob.cube(3));
ob.addScore(40);
ob.addScore(25);
System.out.println("total = " + ob.total);
}
}
// Output
27 27
total = 65
Calling cube(3) twice gives 27 twice and nothing else changes. Each call to addScore leaves the object different, which is what makes it impure.
class Passing {
static void swap(int a, int b) {
int t = a;
a = b;
b = t;
System.out.println("Inside: a = " + a + ", b = " + b);
}
static void doubleAll(int[] arr) {
for (int i = 0; i < arr.length; i++)
arr[i] = arr[i] * 2;
}
public static void main(String[] args) {
int a = 30, b = 50;
swap(a, b);
System.out.println("After: a = " + a + ", b = " + b);
int[] m = {3, 5, 7};
doubleAll(m);
System.out.println(m[0] + " " + m[1] + " " + m[2]);
}
}
// Output
Inside: a = 50, b = 30
After: a = 30, b = 50
6 10 14
swap works on copies of 30 and 50, so main's variables do not change. doubleAll receives a reference to the same array, so its changes are seen in main.
| Point | Call (pass) by value | Call (pass) by reference |
|---|---|---|
| What the method receives | A copy of the value | A reference to the same object or array |
| Types passed this way | Primitive types: int, double, char, boolean and the rest | Reference types: arrays and objects |
| Change inside the method | Not seen by the caller | Changes to the object's contents are seen by the caller |
| Example above | swap(a, b) | doubleAll(m) |
Strictly, Java copies the reference itself, which is why assigning a new String or a new array to a parameter does not affect the caller. In the ICSE answer, the definitions in the table are what is expected. Ready-to-learn versions of these definitions are in ICSE Computer Applications chapter-wise notes.
Q5. How is an overloading question marked?
An overloading answer is easy to get mostly right and annoyingly easy to lose marks on. Tick these seven points before moving to the next question. They are the points our teachers mark against in class.
(double x, int n), writing (int n, double x) is a different signature.ob.work(...); a version that is never called shows nothing.| Common slip | Result |
|---|---|
| Two versions differ only in return type | Does not compile: "already defined" |
| Method declared inside main | Does not compile (illegal start of expression): a method cannot be defined inside another method |
| Non-static method called from main without an object | Does not compile: non-static method cannot be referenced from a static context |
| Missing return in a non-void version | Does not compile: missing return statement |
| Digit loop changes n, then n is printed in the message | Prints 0 instead of the number the user gave |
The same checklist idea, applied to every kind of Section B answer, is on how to score 100 in ICSE Computer Applications.
Q6. How is this chapter taught live?
The chapter is learnt by calling methods, watching which version runs, and writing full answers that are ticked against the checklist.
At the 5:30 PM IST class students see a set of overloaded headers and a list of calls, and write which version each call runs before BlueJ settles it.
Short methods are sorted into pure and impure, and value or reference, out loud, so the theory answers come out in the student's own words.
At the 8:00 PM IST class an original question in board shape is answered on paper in about 20 minutes, then typed and run.
The teacher marks each answer against the seven points with the student watching, and the missed point becomes the first thing checked next week.
Prototype, signature and overloading are favourite oral questions, so they are rehearsed before internal assessment, and overloading appears in the full two-hour mocks from December.
The oral side is covered on ICSE Computer Applications viva questions.
Batch or personalised: you choose
Whichever format you pick, your child gets the same overloading questions, the same drills on which version Java calls and the same seven-point checklist. An Indian family may take the two fixed evenings or a private hour; overseas, only private classes are offered. Billing is month to month and there is 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 student who writes working methods but loses marks on names, signatures or a missing main usually needs only a few one to one sessions with the checklist. A student still unsure how parameters and return values work does better with the steady rhythm of two batch classes a week. Fees show in your own currency.
Studying outside India?
A CISCE school in the Gulf or South East Asia writes the very same Computer Applications paper, and an overloading program is worth just as much there. Families abroad get private classes, timed to fit after 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 |
We agree the hour once the free demo is done, and shift it when school tests get in the way. More detail for overseas families is 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 methods and overloading
Function overloading means writing two or more methods with the same name in one class, where each has a different parameter list: a different number of parameters, different types, or the same types in a different order. Java picks the version to run by matching the arguments in the call. It is how the Class 10 syllabus shows polymorphism.
No. Java tells methods apart by their signature, which is the name and the parameter types. Two methods with the same name and parameters but different return types have the same signature, so javac reports that the method is already defined. The parameter list must differ.
The prototype is the whole first line of the method: access specifier, return type, name and parameter list, for example public double area(double l, double b). The signature is only the name and the parameter types in order, area(double, double). Overloaded methods must have different signatures.
A pure method returns a value that depends only on its parameters and does not change anything outside itself, so calling it twice with the same arguments gives the same result. An impure method changes something outside itself, such as a data member of the object or the contents of an array passed to it.
In call by value the method receives a copy of a primitive value, so changes inside the method do not affect the caller. In call by reference the method receives a reference to an object or array, so changes made to its contents are seen by the caller. The syllabus asks for call by value with programs and call by reference as a definition with an example.
Formal parameters are the variables named in the method header that receive values, such as l and b in area(double l, double b). Actual parameters are the values or variables written in the call, such as 7.5 and 4 in ob.area(7.5, 4). Their number, types and order must match a version of the method.
Java widens the argument to the nearest type that has a version. A char argument goes to an int version before a double one, and a long or float argument goes to a double version. If two versions fit equally well after widening, the call is ambiguous and the program does not compile.
A static method belongs to the class and can be called without creating an object, like Math.sqrt. A non-static method belongs to each object and is called through an object, like ob.work(5). Calling a non-static method directly from the static main method, without an object, does not compile.
An overloading program is usually set as a full Section B question, and each Section B question carries 15 marks; students answer any four of the six. Overloading also appears in Section A as short theory or output questions about which version is called.
Yes. In the ICSE mini batch on Tuesday at 5:30 PM and Wednesday at 8:00 PM IST, students predict which overloaded version runs, write a timed overloading answer and have it marked against a checklist on screen. Families who need another time can choose personalised one to one classes.
Start
In the free demo your child predicts which overloaded method each call will run, writes one version of an overloading question with the mentor, and runs it in BlueJ. Afterwards you hear which parts of the methods chapter are secure and which need work, and whether the mini batch or one to one fits better.
Prefer to see the whole subject first? Look at ICSE Computer Applications important questions 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