"In addition to static methods, there are static classes. We'll discuss these in more detail later. For now, let me just show you an example:"

public class StaticClassExample
    private static int catCount = 0;

    public static void main(String[] args) throws Exception
        Cat bella = new Cat("Bella");
        Cat tiger = new Cat("Tiger");

        System.out.println("Cat count " + catCount);

     public static class Cat
        private String name;

        public Cat(String name)
            this.name = name;

Module 1. Java Syntax,  level 11lesson 4
Displaying arrays
Implement the main(String[]) method, which displays the strings and ints arrays on the console using the Arrays.toString() method.

"You can create as many Cat objects as you want. But this isn't the case with a static variable. Only one copy of a static variable exists."

"The main purpose of using the static modifier in the class declaration is to control the relationship between the Cat and StaticClassExample classes. The idea is roughly this: the Cat class is not linked to StaticClassExample objects and can't access the instance (non-static) variables of the StaticClassExample class."

"So I can create classes inside classes?"

"Yes. Java allows that, but don't give it too much thought right now. It will become clearer when I explain some more things to you in the future."

"I hope so, Rishi."