Good afternoon, in my project I have the following attributes and constructor of an Abstract Class:
//Attributes
private int number;
//Constructor
public Card ( int number ) {
this.number = number ;
}
From which it inherits the following Class:
public abstract class SpainCard extends Card {
//Attributes
private int number ;
private String suit ;
//Constructor
public SpainCard(int number, String suit) {
super(number);
this.suit = suit;
}
My query is the following, which generates the reserved word super(number);
in the constructor of my Abstract class SpainCard
? Am I inheriting the attribute int number
from my class
father, or what does JAVA do internally when using super();
?.
It is a query so that you can better understand how it works and it is used in a good way super();
since my code works like this, but I have doubts about what it does exactly.
Thank you very much, I hope you can explain me in more detail.