// I often encounter a student using GUI programming environment who is // unable to find the directory in which his program is executing. This // makes doing file I/O a bit more complicated. To simplify things, // here's code to simply ask the program where it is. public class WhereAmI { public static String currentWorkingDirectory() { return System.getProperty("user.dir"); } // currentWorkingDirectory public static void main(String[] args) { System.out.println(currentWorkingDirectory()); } // main() } // class WhereAmI