Search⌘ K
AI Features

Methods

Explore how Java methods function as abstractions for object actions, learn to interpret method signatures, understand access control with public and private keywords, use static methods, and recognize return types. This lesson helps you grasp how methods enable coding functionality without exposing details.

Methods determine what functions an object can perform. In fact, another name for method is literally function.

Method: an abstraction

A class’s method is an abstraction for the user. The user only needs to know what a method does, not how a method does something.

For example, in a previous lesson, we discussed the Quadrilateral class. It may have a method to calculate the area. Let’s call it calculateArea ...