Question: When writing Java code for the sublcass of a class, the first line of the constructor must be the call to super ( ) .

When writing Java code for the sublcass of a class, the first line of the constructor must be the call to
super (). Please explain which of the solid principles mandates this. (2 marks).
Now consider this code:
public class IntSet {
private Vector elements;
public IntSet(){
element = new Vector();
bs
}
public class MaxIntSet extends IntSet{
public MaxIntSet (){
// no code written here
hs
}
Is the principle identified in previous part is still broken? Explain why. (2 marks)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!