1
public TableViewerTest() {
    super(null);
    model = new PlayerTableModel();
}

what does super(null) do here. I am new to java so was not able to figure out.

Suhail Ahmed Khan
  • 665
  • 2
  • 8
  • 10
  • passing null value(referring it to null) to a super class parameterized constructor – Shriram Apr 27 '15 at 06:30
  • super(null) is used when the parent class does not have default constructor (with no parameters). Here, the parent class - Person - does not have default constructor. so the sub class used -super(null). class Person { Person(String s) { super(); } } class Employee extends Person { Employee(String s) { super(null); } – user3055964 Feb 16 '21 at 15:22

2 Answers2

2

It calls the constructor of the super class with parameter null.

Jens
  • 67,715
  • 15
  • 98
  • 113
0

super(null) call a constructor of the super class of TableViewerTest which accepts a single reference type argument. It passes null to that constructor.

Eran
  • 387,369
  • 54
  • 702
  • 768