Home Segments Top Top Previous Next

301: Mainline

Thus, to modify the one-parameter constructors in the Movie class and the Symphony class, such that they call the one-parameter constructor in the Attraction class, you add super constructor calls to both:

public class Movie extends Attraction { 
 ... 
 public Movie (int m) { 
  super(m);  <-------------------  Call to one-parameter constructor 
 }                                 in Attraction class 
 ... 
} 

public class Symphony extends Attraction { 
 ... 
 public Symphony (int m) { 
  super(m);  <-------------------  Call to one-parameter constructor 
 }                                 in Attraction class 
 ... 
}