• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Magic! Magic!

 
Ranch Hand
Posts: 63
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..


 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks .....
I didnot think that...
mistake...

any way thankyou very much...
 
reply
    Bookmark Topic Watch Topic
  • New Topic