Hello,
How would I count the number of files in a directory? Thanks!
christiangirl
10
Junior Poster
Recommended Answers
Jump to PostlistFiles() and use the length of the returned array?
See the API docs for File.
Jump to PostSee the API docs for File.
Jump to PostHow do you normally use an array?
String[] files = file.listFiles(); int numFiles = files.length;
All 9 Replies
masijade
1,351
Industrious Poster
Team Colleague
Featured Poster
christiangirl
10
Junior Poster
masijade
1,351
Industrious Poster
Team Colleague
Featured Poster
christiangirl
10
Junior Poster
masijade
1,351
Industrious Poster
Team Colleague
Featured Poster
christiangirl
10
Junior Poster
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
meglizhem
0
Newbie Poster
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.