Chandra --
Welcome to JavaRanch!
When you have a chance,
please take a look at the "Asking good questions" link in my signature below -- in particular, there are sections about how to choose a forum for your post (carefully), how many forums
you should post in (one), and choosing a meaningful subject line.
You've made seven posts at JavaRanch, in three different forums, over a few days; all of them concern this same problem. You started three different threads in this "Java in General (Advanced) forum alone, when this definitely isn't an advanced problem. If you had chosen an appropriate forum the first time (the
Java Beginner's forum), and stuck with that one thread, then by now, you'd surely have had a meaningful conversation about this problem and learned how to solve it. But because you've been jumping all over the place, you just keep getting the same short answer over and over again.
I've closed all your other threads.
Please don't start a new one for this problem. Instead, continue the discussion in this one until your problem is solved.
I'm moving this thread to "Java in General (Beginner)" -- please continue the conversation there.