© Kishori Sharan 2017
Kishori SharanBeginning Java 9 Fundamentalshttps://doi.org/10.1007/978-1-4842-2902-6_8

8. Methods

Kishori Sharan
Montgomery, Alabama, USA
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 ...

Get Beginning Java 9 Fundamentals: Arrays, Objects, Modules, JShell, and Regular Expressions now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.