Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Magic! Magic!

 
Moguluri Ravi Kiran
Ranch Hand
Posts: 63
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15484
43
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Moguluri Ravi Kiran
Ranch Hand
Posts: 63
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks .....
I didnot think that...
mistake...

any way thankyou very much...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic