Chapter 6
Chapter 6
Fields for which each object of a class does not have a separate instance
(copy) of them are declared static and are also known as class
variables.
All objects of a class containing static fields share one copy of those
fields.
Together the class variables (i.e., static variables) and instance variables
represent the fields of a class.
We've declared a class called 'Stuff' and given it one public static variable of
type String.
We've initialized the variable to the String value "I'm a static variable".
Application.java:
Output :
corresponding parameter.
classes.
Some key Java API packages are described in Fig. 6.5.
Overview of the packages in Java SE 6:
download.oracle.com/javase/6/docs/api/
overview-summary.html
Java API documentation
download.oracle.com/javase/6/docs/api/
Used to create several methods with the same name that perform
the same or similar tasks, but on different types or different
numbers of arguments.