In German, words have gender, at least that's how I was taught. "Der" is for masculine nouns, "die" for feminine nouns and "das" for genderless nouns. Sometimes it doesn't really make sense, like for "das mädchen", you'd expect a girl to be female, but the word isn't.. Works for Mann and Frau though, and many other words.
Duh! ;p But yes, the word apple is a masculine noun. "Masculine", "feminine" and "genderless" shouldn't be taken too literally in the case of nouns, though it can help you remember some of them. If you think "apples are red which is a manly colour so apples are masculine" makes sense, then that's helpful I guess.