Hi Rasika. Unfortuantely your question isn't about the
SCJD exam. I am going to move this
thread to the Java-Beginner's forum.
I would really suggest that you avoid using runtime.exec to run OS specific commands. Since Java is write once run anywhere, you are breaking this rule and making it OS specific.
There is the File class that can get a list of files, and do some file stuff, as I am sure other classes already built that are OS independant that you can use to get the results you want.
Mark