Declaring Methods  «Prev  Next»


Lesson 10

Java Field Variables Conclusion

The following list summarizes the important points that were covered in this module with respect to Java Field Variables.
  1. Field variables may be declared using the modifiers final, private, protected, public, static, transient, and volatile. Local variables may be declared final.
  2. An array's dimensions must be specified using a pair of matching braces (i.e., []). Braces may be placed to the right of the array type or to the right of the array identifier. Zero or more spaces may be placed around each brace.
  3. this refers to the current object instance. super is used to refer to the variables and methods of the superclass of the current object instance.
  4. Method modifiers are abstract, final, native, private, protected, public, static, or synchronized.
  5. When an argument is passed to a method, the argument's value is copied before being made available to the method via a parameter.
  6. Static initializers are used to initialize the static variables of a class or invoke the methods of static variables. Non-static initializers are used to update and invoke the methods of non-static variables.
  7. Java supports the public, protected, and private access modifiers. It also supports package access, when no other modifier is specified.
  8. A method is overloaded in a class declaration when two or more methods have the same name but different parameters. That is, the methods differ in the number of parameters, types of parameters, or ordering of their parameter types.
  9. Overriding occurs when a method is declared with the same name, parameter types, and return type as a method that is inherited from one of its superclasses.


Key Terms and Concepts

  1. Field variable: A variable that is a member of a class.
  2. Field: Short for field variable.
  3. Member variable: Another name for a field variable.
  4. Current object instance: The current object that is being executed.
  5. Method signature: The name of the method and the number and types of formal parameters to the method.
  6. Initializer: A block of code that is used to initialize a variable.
  7. Static initializer: A block of code that is used to initialize a static variable.
  8. Package access: The default access that occurs when no access modifier is specified. Access is restricted to the package in which an item is declared. Also referred to as friendly access.
  9. Friendly access: The default access that occurs when no access modifier is specified. Access is restricted to the package in which an item is declared. Also referred to as package access.
  10. Serialized: Written to a stream.

Java Terms Defined

Click the link below to read about the Java Terms defined in this module.
Java Terms Defined

Java Review - Quiz

Click the Quiz link below to check your understanding of declaring methods.
Java Review - Quiz