Relative Content

Tag Archive for javafilejava.util.scanner

Which way should slashes be?

im learning java and am curious about something. like with slashes in file paths. i know that im supposed to use / in the code. but what about when reading in a file path from another file? so like i read in file myFile with Scanner and in myFile is filepath C:directorymyFilePath.txt and then put that filepath in new File object. so should the slahses in C:directorymyFilePath.txt when its first of all written in myFile be / or on windows?