This chapter reviews method parameters and local variables, as well as method overloading and method signature.
Method overloading means two or more methods have the same name but have different parameter lists: either a different number of parameters or different types of parameters. When a method is called, the corresponding method is invoked by matching the arguments in the call to the parameter lists of the methods. The name together with the number and types of a method's parameter list is called the signature of a method. The return type itself is not part of the signature of a method.
20. End of the Chapter
Answer:
println( String x )
String concatenation is performed before println()
is called, resulting in an argument that is a String
reference.
End of the Chapter
End of the Chapter
You have reached the end this chapter. You may wish to review the following, unless you feel overloaded. Click on a subject that interests you to go to where it was discussed.
- parameter passing Passing a value to a method.
- parameter, formal and actual Formal and Actual parameters.
- scope, of formal parameter The scope of a formal parameter.
- visibility of variables What the statements of a method can "see."
- parameter, assignment to Assignment of values to a parameter.
- local variable Local variables.
- scope, of local variable The scope of a local variable.
- overloading, of methods Overloading.
- signature Signature of a method.