---
title: "super() and this()"  
description: "super() and this()"  
author: "Anonymous User"  
published: 2018-06-22  
updated: 2018-06-22  
canonical: https://www.mindstick.com/forum/34536/super-and-this  
category: "java"  
tags: ["java"]  
reading_time: 2 minutes  

---

# super() and this()

What is the [difference](https://www.mindstick.com/articles/157114/good-news-or-bad-news-and-the-difference-is) between [super](https://yourviews.mindstick.com/story/4496/5-super-ayurvedic-food-for-bodybuilding)() and this() ? [explain](https://www.mindstick.com/forum/157854/what-is-system-debugging-explain-some-system-debugging-tools-used-in-modern-computer-systems) with example.

## Replies

### Reply by Prakash nidhi Verma

Difference between super() and this() in java:

super() as well as this() both are used to make constructor calls. super() is used to call Base class’s constructor coz they are Parent’s class while this() is used to call current class’s constructor.We can use super() as well this() only once inside constructor.

Example super() :

```
 
class Parent {     Parent()
    { System.out.println("mindstick " + " arg constructor");
}  }

class Child extends Parent {
    Child()
    {
        super();
        System.out.println("software" +
                        "Parent class no arg const");
    }
    public static void main(String[] args)
    {
        new Child();
        System.out.println("Inside Main");
    }
}
```

Example this() :

```
class MM {     MM()
    {
 this(10);
        System.out.println("Flow comes back from " +
"MM class's 1 arg const");
    }

    MM(int a)
    {
        System.out.println("MM class's 1 arg const");
    }
    public static void main(String[] args)
    {
        new MM();
        System.out.println("Inside Main");
    }
}
```


---

Original Source: https://www.mindstick.com/forum/34536/super-and-this

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
