In Java, methods are always defined as part of a class. 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 the this keyword to refer to the current instance of the class within a method, similar to how the receiver is used in some other languages.
Next, we’ll look at Java’s mechanism for defining abstract types and behaviors: interfaces.