In Java, all methods are associated with classes, and there’s no distinction between pointer and value receivers as in some other languages. Methods are always called on objects (instances of classes) or, in the case of static methods, on the class itself.
Java uses object references instead of pointers. When you create an object with new, you’re working with a reference to that object. There’s no need to use & to get a reference or * to dereference.
Next, we’ll look at Java’s mechanism for defining contracts for classes: interfaces.