Hello coders, Let’s imagine we want to create a method which is going to return just single value, an integer, as shown below: Here, getCoordinates() returns int value. Pretty simple, now let’s modify getCoordinates() to handle x-coordinates and y-coordinate, so created a class Coordinates.