~/ learn/ comp-308/ cards/ File, Path & the filesystem
1 of 3

A relative path resolved against the working directory

A relative path resolved against the working directory

Answer

File out = new File("dump.out"); if (out.exists()) System.out.println(out.getAbsolutePath());

A relative File names dump.out in the current working directory; getAbsolutePath() resolves it. No machine-specific path is baked in.

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/4921f4ce-0cf6-45be-82ed-9433d4ccdf22/flashcard utf-8 LF