🌐
Programiz
programiz.com › java-programming › super-keyword
Java super Keyword (With Examples)
To explicitly call the superclass constructor from the subclass constructor, we use super(). It's a special form of the super keyword. super() can be used only inside the subclass constructor and must be the first statement.
🌐
BeginnersBook
beginnersbook.com › 2014 › 07 › super-keyword-in-java-with-example
Super keyword in java with example
September 11, 2022 - We will learn method overriding in the next tutorials of this series. For now you just need to remember this: When a child class overrides a method of parent class, then the call to the method from child class object always call the child class version of the method. However by using super keyword like this: super.method_name you can call the method of parent class (the method which is overridden).
Discussions

Can someone please explain the 'super' keyword in Java like I'm eight years old?
Lets say I have a Human class. Since we know that classes are like plans to build something I can say that this class was used to build the Mom object and the Dad object. Now I've created a new class: Kid. This class extends the Human class, and well, that's how kids are made. Now lets say that the human class has a Sing() method that causes the Mom or Dad object to Sing "Don't worry be happy." The Kid class overrides that Sing() method, causing Kids to sing "the wheels on the bus go round and round." But one day, one of the kids (constructed with the kids class) wants to sing like Mom. That's where the super keyword comes in. We can make a new method in the Kid class called SingLikeAHuman(). In this method we can call super.Sing() The thing to note here is that the Kid class has a Sing() method already. Because of that I can't access the Human classes Sing method. The super keyword provides us with a way to access methods that are otherwise hidden by being overridden. More on reddit.com
🌐 r/learnprogramming
4
5
September 26, 2013
Java generics super keyword - Stack Overflow
I went through these topics Generics..? Super T Bounding generics with 'super' keyword However, I still seem to be kind of lost with super keyword: When we declare a collection like that: List&l... More on stackoverflow.com
🌐 stackoverflow.com
ELI5 - What is super keyword in java
Let's say I have a class X that extends class Y. Class Y is called the superclass of class X. The super keyword refers to the superclass of the class you are working in now. So suppose, for instance, that X has a method f(), and Y has a method g(). Inside f, I might call super.g(), which calls the g() method inside the superclass Y. This is primarily useful if g() is overriden in X, but I want to call the implementation in Y anyway. In this case this.g() would call X.g(), whereas super.g() would call Y.g() More on reddit.com
🌐 r/explainlikeimfive
4
0
October 4, 2024
Clarification on this(); and super();
this(); Calls the default constructor of the class you are in. super(); Calls the super-class default constructor of the class you are in. You can use these to simplify your object-construction: public MyObject() { this.var1 = "something"; this.var2 = "something else"; this.var3 = null; } public MyObject(String valueForVar3) { this(); // calls the above constructor this.var3 = valueForVar3; } public MyObject(String valueForVar3, int printCount) { this(valueForVar3); // calls the above constructor for (int i = 0; i < printCount; i++) { System.out.println("var3 is: " + this.var3); } } public static void main(...) { MyObject mo1 = new MyObject(); //mo1.var1 = "something" //mo1.var2 = "something else" //mo1.var3 = null; MyObject mo2 = new MyObject("hello world"); //mo2.var1 = "something" //mo2.var2 = "something else" //mo2.var3 = "hello world"; MyObject mo3 = new MyObject("hello tacos", 50); //mo3.var1 = "something" //mo3.var2 = "something else" //mo3.var3 = "hello tacos"; } Using this pattern, you can add increasingly fine-grained control of your objects. When using inheritance, you can use a super(...) call to call an appropriate super-method. In short, this() and super() are only valid for constructing objects. If you reference this. or super. (without the parentheses,) you are referencing an object. this. being the current class (or superclass, if no matching element exists in the current class). While super. tells the compiler that you are explicitly trying to call something/access something in a super-class. Edit: Official doc on using this. and this() Edit2: Official doc on using super. and super() More on reddit.com
🌐 r/java
44
23
April 10, 2012
People also ask

Why is Super important in Java?
Super is crucial in Java for accessing, initializing, and maintaining superclass-subclass relationships, enabling code reusability.
🌐
simplilearn.com
simplilearn.com › home › resources › software development › super keyword in java: an ultimate guide
Super Keyword in Java: An Ultimate Guide
Mention any three usages of the Java super keyword.
Access superclass members: It allows a subclass to use variables and methods from its parent class. Call superclass constructors: It invokes constructors in the parent class, ensuring proper initialization. Maintain inheritance relationships: Helps build a hierarchy of classes where subclasses inherit features from superclasses.
🌐
simplilearn.com
simplilearn.com › home › resources › software development › super keyword in java: an ultimate guide
Super Keyword in Java: An Ultimate Guide
What is the use of the super keyword in variables?
The super keyword in variables distinguishes superclass and subclass variables when they share the same name.
🌐
simplilearn.com
simplilearn.com › home › resources › software development › super keyword in java: an ultimate guide
Super Keyword in Java: An Ultimate Guide
🌐
Simplilearn
simplilearn.com › home › resources › software development › super keyword in java: an ultimate guide
Super Keyword in Java: An Ultimate Guide
July 31, 2025 - Master Java inheritance with 'super' keyword! Unleash its power to refine object-oriented code & build robust applications. Read to know more!
Address   5851 Legacy Circle, 6th Floor, Plano, TX 75024 United States
🌐
DataCamp
datacamp.com › doc › java › super
super Keyword in Java: Usage & Examples
Learn how to use the `super` keyword in Java to call superclass constructors, access overridden methods, and hidden fields. Enhance your Java programming skills with practical examples and best practices.
🌐
Wordpress
mantavya.files.wordpress.com › 2020 › 01 › super-keyword-in-java.pdf pdf
Super Keyword in Java
Super Keyword in Java · The super keyword in java is a reference variable that is used to refer parent class · objects. The keyword “super” came into the picture with the concept of Inheritance. It is majorly used in the following contexts: 1. Use of super with variables: This scenario ...
🌐
Geekster
geekster.in › home › super keyword in java
Super Keyword in Java
June 27, 2024 - The ‘super’ keyword allows referencing the parent class or superclass of a subclass in Java. It is often employed to access members (fields or methods) of the superclass that have been overridden in the subclass.
🌐
ScholarHat
scholarhat.com › home
Super Keyword in Java: A Beginner's Guide to Using Super in Java
September 3, 2025 - If a method is called without the super keyword, if it isn't overridden in the subclass, it will call the implementation of the parent class. In Java, the super keyword is used to access superclass methods and constructors.
Find elsewhere
🌐
Quora
quora.com › What-exactly-is-the-function-of-the-super-keyword-in-Java
What exactly is the function of the 'super' keyword in Java? - Quora
Answer (1 of 10): The super keyword in java is a reference variable that is used to refer immediate parent class object. Whenever you create the instance of subclass, an instance of parent class is created implicitly i.e. referred by super reference ...
🌐
Oracle
docs.oracle.com › javase › tutorial › java › IandI › super.html
Using the Keyword super (The Java™ Tutorials > Learning the Java Language > Interfaces and Inheritance)
See Java Language Changes for a summary of updated language features in Java SE 9 and subsequent releases. See JDK Release Notes for information about new features, enhancements, and removed or deprecated options for all JDK releases. If your method overrides one of its superclass's methods, you can invoke the overridden method through the use of the keyword super.
🌐
GeeksforGeeks
geeksforgeeks.org › java › super-keyword
Super Keyword in Java - GeeksforGeeks
The super keyword in Java is a reference variable that is used to refer to the parent class when we are working with objects.
Published   July 23, 2025
🌐
The Knowledge Academy
theknowledgeacademy.com › blog › super-keyword-in-java
Super Keyword in Java: An Introductory Overview
September 9, 2025 - The Super Keyword in Java serves as the bridge between child and parent classes in inheritance, unlocking access to parent methods, constructors, and variables.
🌐
W3Schools
w3schools.com › java › ref_keyword_super.asp
Java super Keyword
To understand the super keyword, you should have a basic understanding of Inheritance and Polymorphism. Read more about inheritance (subclasses and superclasses) in our Java Inheritance Tutorial.
🌐
Reddit
reddit.com › r/learnprogramming › can someone please explain the 'super' keyword in java like i'm eight years old?
r/learnprogramming on Reddit: Can someone please explain the 'super' keyword in Java like I'm eight years old?
September 26, 2013 -

I'm currently taking a Java course at my school and I couldn't really find any simple answers online. If anyone could help I would really appreciate it.

🌐
Unstop
unstop.com › home › blog › super keyword in java | uses, limitations & more (+examples)
Super Keyword In Java | Uses, Limitations & More (+Examples) // Unstop
October 30, 2024 - The super keyword in Java allows a subclass to access its superclass’s methods, fields, and constructors, useful in inheritance to invoke or extend parent behavior.
🌐
Hero Vired
herovired.com › home › learning-hub › topics › super-keyword-in-java
Super Keyword in Java - Uses and Examples
August 20, 2024 - The super keyword in object-oriented programming languages, such as Java, refers to the immediate parent class of the current class instance. It serves multiple purposes. It allows access to overridden methods in the parent class.
🌐
Igmguru
igmguru.com › blog › super-keyword-in-java
Super Keyword in Java: With Examples (Updated 2025)
4 weeks ago - I have created this blog to walk ... In Java, the super keyword is a reference variable used within a subclass to access members (methods, fields, and constructors) of its immediate parent class....
🌐
Baeldung
baeldung.com › home › java › core java › guide to the super java keyword
Guide to the super Java Keyword | Baeldung
January 8, 2024 - Let’s create a child class instance and see what’s happening behind: SuperSub child = new SuperSub("message from the child class"); The new keyword invokes the constructor of the SuperSub, which itself calls the parent constructor first and passes the String argument to it.
🌐
DEV Community
dev.to › mukeshb › mastering-super-keyword-in-java-a-beginners-guide-to-inheritance-1lob
Mastering super Keyword in Java: A Beginner's Guide to Inheritance - DEV Community
July 8, 2025 - In Java, super is reference variable used to refer to immediate parent class object. Whenever you create an instance of subclass, an instance of its superclass is also created, and super points to it.
🌐
GeeksforGeeks
geeksforgeeks.org › java › super-and-this-keywords-in-java
super and this keywords in Java - GeeksforGeeks
June 10, 2024 - In java, super keyword is used to access methods of the parent class while this is used to access methods of the current class.
Top answer
1 of 7
107

The bounded wildcard in List<? super Number> can capture Number and any of its supertypes. Since Number extends Object implements Serializable, this means that the only types that are currently capture-convertible by List<? super Number> are:

  • List<Number>
  • List<Object>
  • List<Serializable>

Note that you can add(Integer.valueOf(0)) to any of the above types. however, you CAN'T add(new Object()) to a List<Number> or a List<Serializable>, since that violates the generic type safety rule.

Hence it is NOT true that you can add any supertype of Number to a List<? super Number>; that's simply not how bounded wildcard and capture conversion work. You don't declare a List<? super Number> because you may want to add an Object to it (you can't!); you do because you want to add Number objects to it (i.e. it's a "consumer" of Number), and simply a List<Number> is too restrictive.

References

  • Angelika Langer's Generics FAQs
    • What is a bounded wildcard?
    • When would I use a wildcard parameterized type with a lower bound? ("When a concrete parameterized type would be too restrictive.")
    • Why is there no lower bound for type parameters? ("Because it does not make sense.")
  • JLS 5.1.10 Capture Conversion

See also

  • Effective Java 2nd Edition, Item 28: Use bounded wildcards to increase API flexibility
    • "PECS stands for producer-extends, consumer-super

Related questions

  • Too many to list, PECS, new Integer(0) vs valueOf, etc
2 of 7
26

For the first part List<Number> fits in List<? super Number> but you can't add an Object to a List<Number>. That's why you can't add an Object to List<? super Number>.

On the other hand you can add every subclass of Number (Number included) to your list.

For the second part, String is an Object, but String isn't a superclass of Number.

If it worked like this, as every class is a subclass of Object, super would have no meaning.


Let's see every possible cases with List<? super Number> :


  • The passed list is a List<Object>
    • List<Object> will work
    • Object fits in <? super Number>
    • You can add any subtype of Number to a List<Object>
    • Even if you could also add String in it the only thing you're sure of is that you can add any subclass of Number.

  • The passed list is a List<Number> :
    • List<Number> will work
    • Number fits in <? super Number>
    • You can add any subtype of Number to a List<Number>

  • The passed list is a List<Integer> (or any subclass of Number):
    • List<Integer> won't work
    • Integer is a subclass of Number so it is exactly what we want to avoid
    • Even if an Integer fits in a Number you wouldn't be abble to add any subclass of Number in a List<Integer> (for example a Float)
    • super doesn't mean a subclass.

  • The passed list is a List<String> (or any class not extending Number nor in the "super hierarchy" of Number (ie. Number and Object) :
    • List<String> won't work
    • String doesn't fit in Number "super hierarchy"
    • Even if String fits in Object (which is a super class of Number) you woudln't be sure to be able to add a Number to a List that contain any subclass from one of the super classes of Number)
    • super doesn't mean any subclass of one of the super classes, it only means one of the super classes.

How does it work ?

You could say that as long as you can add any subclass of Number with your typed List, it respects the super keyword.