• 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
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
Bartenders:
  • Himai Minh
  • Carey Brown
  • Frits Walraven

Sybex OCP11 - Chapter 1 - Possibly inaccurate content of wildcards for subdirectories

 
Greenhorn
Posts: 6
1
Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I stumbled across a part in the book that confused me for a bit, until I tried it on a few examples. On page 22 in the box "Compiling with wildcards" it says: "However, you cannot use a wildcard to include subdirectories."

It is not correct as such, as you can use

to compile all java files in all subdirectories (one level down only).

Despite the sentence afterwards giving an example, the fact if wildcards cannot be used at all in order to inclue subdirectories still wasn't clear.
I think it can be confusing for someone just starting and learning a few pages earlier that wildcards in import statements are only allowed in the last place. It is easy to assume this might work here the same way.

Do you think rewriting it as "However, you cannot use *.java to include java files in subdirectories" or "However, you cannot use the wildcard in the filename to include java files in subdirectories" would make this part clearer?
 
author & internet detective
Posts: 40685
827
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Anke,
* matches a single directory, not a subdirectory. Good point about the distinction between import though!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic