I have a quick Android development question. I am working on an exercise and I have a class that gets the current date and time. The exercise wants me to try and format the date's text to something in a more readable human form. This is what I had which returned a date timestamp.
mDateButton.setText(getDate().toString());
So then to format the returned date to a more readable format this is what I did, with the help of a Google search.
mDateButton.setText(DateFormat.format("EEEE, MMM d, yyyy", mCrime.getDate()).toString());
And it works, but my question is before getting the answer from a google search, how would I have known to put the DateFormat class before the returned value of my method for getDate(). I was putting it after the getDate() call. Is there some order I should be learning with OOP, because this is where I get stuck all the time.