In this chapter, you will learn:
- What methods are and how to declare methods in a class
- The meaning of the pronouns this and super in a Java program
- What local variables are and rules for using them
- How to invoke methods of a class
- Different parameter-passing mechanisms in general, and then, the parameter-passing mechanisms in Java
- How to declare and use var-args parameters
Example classes in this chapter are in the com.jdojo.cls package, which is a member of the jdojo.cls module. You created the jdojo.cls module in Chapter
7
.
What Is a Method?
A method
in a class defines a behavior of the ...