Home Segments Top Top Previous Next

216: Mainline

Now you can understand how the instance-creation expression shown in Segment 173 works, and why it has parentheses:

new Movie() 

The parentheses, with no arguments, indicates that a zero-parameter constructor is to be called. In Segment 173, no constructors are defined, so the do-nothing default constructor, supplied by Java, is called.