Home Segments Top Top Previous Next

213: Mainline

To tell Java to use the three-parameter constructor, blocking the involvement of the zero-parameter constructor, you modify the Movie creation statement:

 *-- Declare m to be a variable of class Movie 
 | 
 |                     *-- Use argument list with three arguments 
 |                     v 
 v                   ------- 
Movie m = new Movie(8, 9, 6); 

The arguments dictate that initialization is to be done with the three-parameter constructor; it is not to be done with the zero-parameter constructor.