This week's book giveaway is in the OCAJP forum. We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line! See this thread for details.
I expect that Yahoo! Messenger clients communicate with the Yahoo! Messenger server over http and https or ssl.
Assuming that you know what data to send to the Yahoo! Messenger server (and how to interpret the data that gets sent back) then you would need to use some of the following classes/interfaces in the javax.microedition.io package -