The correct answer is the first statement.
In the 2008 election, experience was one of several differences between Obama and McCain. John McCain has been a Senator who represents the state of Arizona for over 20 years by the time of the 2008 election. He had been elected to the Senate for the first time in 1987.
On the other hand, Obama was elected Senator of Illinois in 2005. He resigned from this position upon winning the 2008 presidential election.