super()
simile a this ma serve per richiamare elementi della classe di origine




esempio:
class Super_class classe principale
{

int num = 20;

// display metodo della superclass
public void display()
{
System.out.println("This is the display method of superclass");
}
}


classe estesa
public class Sub_class extends Super_class
{
int num = 10;

// display metodo della classe estesa (non della pricipale)
public void display()
{
System.out.println("This is the display method of subclass");
}


public void my_method()
{
// oggetto subclass
Sub_class sub = new Sub_class();


// invoco il metodo display della estesa
sub.display();


// invoco il metodo display della superclass
super.display();


// printing the value of variable num of subclass
System.out.println("value of the variable named num in sub class:"+ sub.num);


// printing the value of variable num of superclass
System.out.println("value of the variable named num in super class:"+ super.num);
}


public static void main(String args[])
{
Sub_class obj = new Sub_class();
obj.my_method();
}
}



soluzione:
This is the display method of subclass
This is the display method of superclass
value of the variable named num in sub class:10
value of the variable named num in super class:20