... variable is initialized to 0
in line 6. If a static
variable is not initialized, the compiler assigns it a default value—in this case 0
, the default value for type int
.
Get Java How to Program, Early Objects, 11th 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.