In "The Happy Prince," Oscar Wilde uses certain characters to represent self-sacrifice and others to represent egotism. The Happy Prince, the statue, represents altruism because he has a strong desire to improve the lives of those he sees in the city who are destitute and needy. He is saddened by the sorrow around him until he is able to enlist the help of the Swallow to benefit others. He literally sacrifices his own eyes, the ruby from his sword, and the gold leaf that is his own covering. He gives of himself until he is no longer beautiful--he has become an eyesore that the Mayor wants to tear down. Likewise, the Swallow sacrifices himself to help the Prince and the needy people of the town. Although he wants to go to Egypt and he knows it is getting too cold for him to stay, he can't leave the Prince, who is now blind; he continues to stay with him to tell him stories and pick off the gold leaf of the Prince to bring it to poor children. Finally it has become too cold for the Swallow to leave, and he dies at the Prince's feet.
Representing egotism are the Mayor and Town Councillors. They can't stand the ugliness of the statue and have it melted down. When the Mayor says they will make a new statue of himself from the metal, all the Councillors repeat what he has said verbatim, meaning they are all clamoring for statues to be made of themselves.
In the final paragraphs of the story, God acknowledges that the Prince and the Swallow were the most precious things in the city, and they receive eternal rewards. The Mayor and his Councillors, though, are "still quarreling." Wilde shows that self-sacrifice brings happiness in this life and in the next while egotism results in continued dissatisfaction. Wilde treats the Swallow and the Prince with respect and tenderness, but he pokes fun at the Mayor and Councillors, using his tone to show the superiority of self-sacrifice over egotism.