/** An example of a class that defines several class methods. **/ public class ClassCounter { private static int count = 0; // a class variable public static void increment() { // class method count++; } public static int getCount() { // another return count; } public static void main(String argv[]) { // The normal way to call class methods, from within the class // or from some other class is: // Classname.methodname( [arguments if any] ); // Even if I make instances of the class, and call the static // methods through the instance references, the results are // not going to work the same way that instance methods would. ClassCounter[] cArray = new ClassCounter[5]; for (int i = 0; i < cArray.length; i++ ) { cArray[i] = new ClassCounter(); for (int num = 0; num < 10; num++) { cArray[i].increment(); } } for (int i = 0; i < cArray.length; i++) { System.out.println("cArray[" + i + "] = " + cArray[i].getCount()); } // What is output from the above? } }