need help understanding relative path and absolute path

Hey everyone, thanks for reading my post. the books I have or the example I saw so far use
somethine like FileOutputStream fos = new FileOutPutStream ("Joan.emp") which create Joan.emp along with the class file
the FileOutputStream is in. what if I want to create a file outside of the directory the class files reside?

Let's say my class File exist in \Pay_Roll\Action\ and I would like to create Joan.emp in \Pay_Roll\emp\

how would I write the new FileOutputStream part?

Can I write it like FileOutputStream fos = new FileOutputStream("\Pay_Roll\emp\Joan.emp");

back slash in java is treated as an escape character so your code should be as follows

Can I write it like FileOutputStream fos = new FileOutputStream("\Pay_Roll\emp\Joan.emp");
should be assuming I am pay_roll\emp directory is under drice c
FileOutputStream fos = new FileOutputStream("c:\\Pay_Roll\emp\Joan.emp");
if the above is OK? what about