In Whitman's "Song of Myself," one should know each of the devices listed so as to rule out the incorrect answers, especially if choices seem similar, or a response does not immediately come to mind that will answer the question precisely.
Alliteration is the repetition of a consonant sound at the beginning of a group of words:
...common in poetry and occasionally in prose, this is the repetition of an initial sound in two or more words of a phrase, line, or sentence.
An example of alliteration can be found in the epic poem Beowulf:
dive down deep
The "D" sound is repeated, located at the beginning of each word. This is not the device that is used by Whitman to address the sea.
Allusion is a reference in literature to a famous person, place or event made by an author for the means of comparison.
The purpose of allusion is to bring a world of experience outside the limitations of a statement to the reader.
It is only effective if the reader is familiar with the subject of the allusion. For example, if we call someone a Scrooge (meaning he or she is stingy), we are alluding to Charles Dickens' A Christmas Carol. If someone is unfamiliar with the story, the comparison falls flat. Allusion is not the answer to the question.
The last two choices are onomatopoeia and apostrophe. Onomatopoeia is a word that stands for the sound it represents, such as "clash" of swords, the "babble" of the brook or "snap, crackle, pop," which are the sounds made by popping a kernel of corn or rice. We see it also in the "snap" of a whip or the "buzz" of a bee. This is not Whitman's device of choice.
We are left with apostrophe. At first glance this may sound simply like punctuation used in writing. In literature, it has another meaning:
Not to be confused with the punctuation mark, apostrophe is the act of addressing some abstraction or personification that is not physically present.
Personification may ring a bell: in literature, it is the process of giving human characteristics to non-human things, something that abounds in the poem. For example:
I behold from the beach your crooked inviting fingers...
The sea does not have fingers, inviting or otherwise. However, figuratively, Whitman describes the waves to be like fingers that reach forward, beckoning the speaker to go into the water.
The first sentence of the poem answers the question easily once we know what "apostrophe" means; Whitman is addressing the sea as if it were a person, though it has no flesh, no physicality:
The poet is calling to the sea as if it were a thing—personifying clearly with the word "you."