---
title: "Java Constructors Explained: Types, Overloading, ICSE"
description: "Constructors in Java explained for ICSE and CBSE: default, parameterised, copy, overloading, this, and constructor vs method, all run with real output."
slug: java-constructors-explained
canonical: https://learn.modernagecoders.com/blog/java-constructors-explained/
date: 2026-07-04
dateModified: 2026-07-04
category: "Java"
tags: ["Java", "Constructors", "OOP", "ICSE", "Exam Preparation"]
keywords: ["constructor in java", "java constructor", "constructor overloading in java", "types of constructors in java", "constructor in java icse", "copy constructor java", "constructor vs method"]
readTime: "8 min read"
author: "Modern Age Coders"
---
# Java Constructors Explained: Types, Overloading, ICSE

> Default, parameterised, copy, overloading, and the constructor-vs-method comparison the paper loves, every example compiled and run.

![Java constructors explained with types, overloading, and ICSE board examples](/images/blog/java-constructors-explained/00-hero.png)

*By Modern Age Coders · 2026-07-04 · 8 min read*

Every ICSE paper finds a way to ask about constructors, a definition here, an output question there, a design a class with... program almost every year. And every year, students who could write the code stumble on the ideas: what exactly runs when, why there is no return type, and what this is doing in there. This guide settles all of it, with every example compiled and executed.

The one-line version first: **a constructor is the method-like block that runs automatically, exactly once, at the moment an object is born**, and its whole job is to give that object its starting values. Everything else in the topic is detail on top of that sentence.

## The Anatomy: What Makes a Constructor a Constructor

Two rules identify a constructor on sight, and both are exam questions in disguise: its name is exactly the class name, and it declares no return type, not even void. Break either rule and Java treats it as an ordinary method.

![Anatomy of a Java constructor: same name as the class, no return type, runs automatically when new creates the object](/images/blog/java-constructors-explained/01-anatomy.png)

*Class name, no return type, triggered by new. Those three facts answer half the theory questions ever set.*

### Your first constructor, watched in action

The print statement inside the constructor is there as proof: watch it fire once per object, automatically, before anything else touches the object.

```java
public class FirstCtor {
    String name;
    int marks;

    FirstCtor(String n, int m) {      // the constructor
        name = n;
        marks = m;
        System.out.println("Constructor ran for " + name);
    }

    public static void main(String[] args) {
        FirstCtor s1 = new FirstCtor("Asha", 92);
        FirstCtor s2 = new FirstCtor("Rohan", 85);
        System.out.println(s1.name + ": " + s1.marks);
        System.out.println(s2.name + ": " + s2.marks);
    }
}
```

```text
Constructor ran for Asha
Constructor ran for Rohan
Asha: 92
Rohan: 85
```

Two objects, two automatic runs, each stamping its own object's data. Nobody called the constructor by name; new did it.

## The Default Constructor

A constructor with no parameters is called a default constructor. It hands every new object the same sensible starting state. One fact examiners love: if you write NO constructor at all, Java quietly supplies an invisible no-argument one, but the moment you write any constructor yourself, that free one disappears.

```java
public class DefaultCtor {
    String name;
    int marks;

    DefaultCtor() {                    // default constructor, no parameters
        name = "Not set";
        marks = 0;
    }

    public static void main(String[] args) {
        DefaultCtor s = new DefaultCtor();
        System.out.println(s.name + " / " + s.marks);
    }
}
```

```text
Not set / 0
```

## Parameterised Constructors and this

When constructor parameters use the same names as the fields, Java needs to know which name means which. this.name always means the object's field; plain name means the nearest parameter. This is the tidiest way to write constructors, and the syllabus expects you to read it fluently.

```java
public class ThisDemo {
    String name;
    int marks;

    ThisDemo(String name, int marks) {
        this.name = name;      // this.name is the field, name is the parameter
        this.marks = marks;
    }

    public static void main(String[] args) {
        ThisDemo s = new ThisDemo("Meera", 96);
        System.out.println(s.name + " scored " + s.marks);
    }
}
```

```text
Meera scored 96
```

## Constructor Overloading

A class can hold several constructors as long as their parameter lists differ. Java picks the version that matches the arguments you pass to new. This is constructor overloading, and it is the single most-asked constructor concept in ICSE program questions.

### Three constructors, one class

```java
public class OverloadCtor {
    String name;
    int marks;

    OverloadCtor() {                      // version 1: no details yet
        name = "Unknown";
        marks = 0;
    }
    OverloadCtor(String n) {              // version 2: name only
        name = n;
        marks = 0;
    }
    OverloadCtor(String n, int m) {       // version 3: everything
        name = n;
        marks = m;
    }

    void display() {
        System.out.println(name + " -> " + marks);
    }

    public static void main(String[] args) {
        new OverloadCtor().display();
        new OverloadCtor("Asha").display();
        new OverloadCtor("Rohan", 85).display();
    }
}
```

```text
Unknown -> 0
Asha -> 0
Rohan -> 85
```

Same class, three doorways in. Count the arguments in each new and you can predict which constructor fired, which is exactly the skill output questions test.

![Constructor overloading in Java: new with zero, one, or two arguments dispatches to the matching constructor](/images/blog/java-constructors-explained/02-overload.png)

*Java matches new to a constructor by counting and typing the arguments. No match, no compile.*

## The Copy Constructor

A copy constructor takes an existing object and builds a new one with the same values. The proof that it truly copied is in the output: changing the duplicate leaves the original untouched.

```java
public class CopyCtor {
    String name;
    int marks;

    CopyCtor(String n, int m) {
        name = n;
        marks = m;
    }
    CopyCtor(CopyCtor other) {            // copy constructor
        name = other.name;
        marks = other.marks;
    }

    public static void main(String[] args) {
        CopyCtor original = new CopyCtor("Zoya", 78);
        CopyCtor duplicate = new CopyCtor(original);
        duplicate.marks = duplicate.marks + 5;   // only the copy changes
        System.out.println("Original : " + original.name + " " + original.marks);
        System.out.println("Duplicate: " + duplicate.name + " " + duplicate.marks);
    }
}
```

```text
Original : Zoya 78
Duplicate: Zoya 83
```

## Constructor vs Method: The Comparison the Paper Loves

The differences fit in one program. The constructor carries the class name, has no return type, and ran exactly once, at new. The method has its own name, declares a return type, and ran every time we called it.

```java
public class CtorVsMethod {
    int balance;

    CtorVsMethod(int start) {         // constructor: class name, no return type
        balance = start;
    }

    int deposit(int amount) {         // method: own name, has a return type
        balance = balance + amount;
        return balance;
    }

    public static void main(String[] args) {
        CtorVsMethod acc = new CtorVsMethod(100);   // constructor runs once, here
        System.out.println(acc.deposit(50));         // methods run whenever called
        System.out.println(acc.deposit(25));
    }
}
```

```text
150
175
```

![Constructor versus method in Java: name, return type, when it runs, and how many times](/images/blog/java-constructors-explained/03-vs.png)

*Four rows that appear in some form on nearly every paper. Learn them as a pair.*

## A Board-Style Program, Start to Finish

Here is the shape ICSE actually asks: design a class with fields, a parameterised constructor, a computing method, and a display method, then create objects and use them.

```java
public class BoardStyle {
    String name;
    int price, quantity;

    BoardStyle(String n, int p, int q) {
        name = n;
        price = p;
        quantity = q;
    }

    int totalCost() {
        return price * quantity;
    }

    void display() {
        System.out.println(name + " x" + quantity + " = Rs " + totalCost());
    }

    public static void main(String[] args) {
        BoardStyle item1 = new BoardStyle("Notebook", 60, 3);
        BoardStyle item2 = new BoardStyle("Geometry box", 120, 1);
        item1.display();
        item2.display();
    }
}
```

```text
Notebook x3 = Rs 180
Geometry box x1 = Rs 120
```

Fields, constructor, method, display, objects. Whatever story the question wraps around it, a shop, a library, a bank, this five-part skeleton is the answer.

## The Mistakes That Cost Constructor Marks

- **Giving the constructor a return type:** void ClassName() compiles, but it is now a method, and new will not call it. The paper sets this trap deliberately.
- **Misspelling the class name:** a constructor named student inside class Student is just an unknown method. Case matters.
- **Expecting the free default constructor after writing your own:** once any constructor exists, new ClassName() fails unless you wrote the no-argument version too.
- **Forgetting this with same-named parameters:** name = name; assigns the parameter to itself and the field stays empty.
- **Calling a constructor like a method:** obj.ClassName() is not a thing. Constructors run through new, once, at birth.

> **The output-question shortcut**

> When a constructor question shows code and asks for output, first mark every new, then match each to its constructor by argument count. The printed lines follow that mapping in order. Two minutes, full marks.

---

## Frequently Asked Questions

**What is a constructor in Java?**

A special block with the same name as its class and no return type, which runs automatically when an object is created with new. Its job is initialisation: giving the new object its starting values.

**What are the types of constructors in Java?**

The ones school syllabi test: the default (no-argument) constructor, the parameterised constructor, and the copy constructor which builds a new object from an existing one. Overloading lets one class offer several of these side by side.

**Why does a constructor have no return type?**

Because its output IS the object being constructed; there is nothing separate to return. Writing a return type, even void, turns it into an ordinary method, which is a favourite trick in board theory questions.

**What is constructor overloading?**

Defining several constructors in one class with different parameter lists. Java selects the matching one by the number and types of arguments passed to new. It lets a class be created from full details, partial details, or none.

**What is the use of this in a constructor?**

this refers to the object being built. Its main use is separating fields from same-named parameters: this.name = name; copies the parameter into the field. Without this, the parameter would just be assigned to itself.

**What happens if I write no constructor at all?**

Java supplies an invisible default constructor that takes no arguments, so new ClassName() still works. But the moment you define any constructor of your own, that automatic one is withdrawn.

**What is the difference between a constructor and a method?**

Name: constructor matches the class, a method has its own. Return type: constructor has none, a method must declare one. Trigger: constructor runs via new, a method via a call. Frequency: once per object versus as often as you like.

## One Idea, Fully Owned

Constructors are a small topic that examiners can slice many ways, and you have now seen every slice run for real: default, parameterised, this, overloading, copy, and the versus-method comparison. Put it to work inside the [50-program ICSE bank](/blog/50-java-programs-for-icse-class-10), where the constructor family closes the set, and see the same idea in Python in our [OOP tutorial](/blog/python-oop-tutorial-for-beginners).

For the version of this topic where a teacher reads your class designs live, our [ICSE Java classes](/java-programming-for-icse-students) are built for it, part of [courses](/courses) serving learners aged 6 to 67.

[Book a Free ICSE Java Demo](/contact)

### Related reading

- [50 Important Java Programs for ICSE Class 10](/blog/50-java-programs-for-icse-class-10)
- [String Handling in Java](/blog/string-handling-in-java)
- [Python OOP Tutorial](/blog/python-oop-tutorial-for-beginners)

---

*Source: https://learn.modernagecoders.com/blog/java-constructors-explained/*
