In Java, methods are always associated with classes. There’s no distinction between pointer and value receivers as in some other languages. All non-primitive types in Java are reference types, so method calls always operate on the same instance of the object.
Java uses object-oriented programming principles, where methods are typically defined within classes. The concept of “receiver” is implicit in Java - the object on which a method is called is always the receiver.
Next, we’ll look at Java’s mechanism for defining contracts for classes: interfaces.