Review Lesson 5 Beginning Java. Summary: Defining Classes Classes consist of both variables (data) and methods (actions performed on data). You can return a single value from a method. This is a good way to communicate the result of a calculation back to the caller. You can pass multiple arguments to a method. The method accesses these arguments like it would any variable. The concept of static vs. instance (for both data and methods) is important. Imagine you have 5 Spheres. They share a single copy of all static data and methods, but they each have their own copies of instance data and methods. The this variable always points to the current object (i.e. the object which owns the currently-running method). Because static methods are shared among many instances, this is not valid inside them. A constructor is a method that creates a new instance of a class and initalizes its instance variables. You can overload methods by defining several methods with the same name but different parameter lists. When you call that method, the compiler uses the parameter list to determine which method you want. Packages are a convenient way to organize your classes. You can give access attributes to your data and methods, controlling who can see them. Public access means that any class can call your method or modify your variable. Protected access means that subclasses of your class and other package members can see your data or method. Private access means that nothing outside of your class can see your data or method. Inner classes are classes defined entirely within another class. Use the finalize() method to free any specially-allocated resources. Native methods allow you to integrate machine-dependent code written in another language with your Java code.