> i am using two methods. one is send method to send
> message and another one is receive method to receive
> message. if i am typeing message that time i want
> check if any message is receive or not.If any receive
> i want to display that receive.
Then have the recipient send you a message that he got yours. What does it have to do with threads?
> thread is listening the receiver method.That time i
> can't type the message.i want to call these methods
> concurrently.
Then do it. Why can't you type a message? Where do you type it?
Either read this: http://java.sun.com/docs/books/tutorial/essential/concurrency/
or write a better and more specific problem description and show us what you're doing. Preferably the former.