This is just a form question.
Using Java, why when trying to return a value from an object do you use object.getData()
from a defined getData()
function within the class instead of simply using object.data
.
They both seem to return the same thing except that object.getData() is more typing and requires you to define a function in the object unnecessarily.