File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Magic!  Magic! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Magic!  Magic! " Watch "Magic!  Magic! " New topic
Author

Magic! Magic!

Moguluri Ravi Kiran
Ranch Hand

Joined: Apr 16, 2010
Posts: 63

Hi something special here

you know how to print all the files names in the current directory with out using File class.
i found this at random. & the output is the list of files in the directory D:\Javap\



if anybody know this before please kindly explain me.

Thanks & regards..


Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14432
    
  23

Moguluri Ravi Kiran wrote:if anybody know this before please kindly explain me.

How this works: If you use wildcards on the command line, like in your command:

D:\javap>java Magic *

then the Windows command prompt will expand the wildcard character * into all the filenames of the files in the current folder. So a command like that is the same as calling your program with the whole list of filenames:

D:\javap>java Magic A.class a.java Aliase.class Aliase.java ar.class ar.java ...

It's not Java that's doing this, but the Windows command prompt itself.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Moguluri Ravi Kiran
Ranch Hand

Joined: Apr 16, 2010
Posts: 63

Thanks .....
I didnot think that...
mistake...

any way thankyou very much...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Magic! Magic!