class Pseudo {
// member variables
// declared in class scope - visible everywhere
...
void inSomeMethod() {
String the_dir = "c:/test";
postData(the_dir);
}
private void postData(String filePath) {
// This method has access to the local variables
// passed in as arguments as well as the member
// variables declared in this enclosing class.
File folder = new File(filePath);
File[] files = folder.listFiles();
for(int j = 0; j < files.length; j++)
System.out.printf("files[%d] = %s%n", j, files[j].getName());
}
}