Default Constructor

In this example, class Time1 does not declare a constructor, so the compiler supplies a default constructor. Each instance variable implicitly receives the default int value. Instance variables also can be initialized when they’re declared in the class body, using the same initialization syntax as with a local variable.

Get Java™ How To Program (Early Objects), Tenth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.