<<< Number class example | Index | Week 6 Reading: pages 53-60 >>> |
It is possible to take attributes outside of instance scope.
This is done by declaring attributes static:
public class Number { private static int count; public void method1() { } }
In this arrangement each instance of the Number object will share a single copy of the count attribute.
<<< Number class example | Index | Week 6 Reading: pages 53-60 >>> |