Static variables belong to the class and called by the class name. The following code illustrates how to call static variable:

The output is:

Meow

You also can use instance of the class to call static method. Take a look at the following:

--

--