How can we encapsulate this code?

Put base, height, and getArea() in the same classPut only base and height in the same class

Put base, height, and getArea() in the same class.