Method parameters and return values

Learn how to define methods in Java, with typed method parameters and typed return values.

Like C, Python, and Javascript functions, a method may take parameters, and may return a single value. Of course, that single value may be a reference to a list, an object, or an array that contains other values. All value in Java must have a type, and method declarations must indicate the type of parameters and the return value.

Get hands-on with 1200+ tech skills courses.