the literary device that Oscar wilde Oscar Wilde use in the title of his play The Importance of Being Earnest is: pun
Pun refers to the use of similar sounding words with different meaning in order to achieve some sort of comedic value. There is one of character in the play named ernest and other character's live is revolved around this character (ernest similar sounding words as earnest).