forward slash vs backward slash
Hi ,
I have a hava class which runs fine on windows .It refers to file on windows as
SYSTEMVARIABLE\Y.TXT
this SYSTEMVARIABLE exist in windows and ulinux
so in windows i have somthing like
SYSTEMVARIABLE=c:\project
and
on linux
SYSTEMVARIABLE=\root\project
how do i make this class to run on both windows and unix
do i ahve to change \ to / and compile again
can a same class works on both os
[465 byte] By [
Sulemana] at [2007-11-26 14:28:58]

> can a same class works on both osAs my instructor told me, one of the beauties of Java is that it's OS independent, since the compiling is linked to the JVM you're running..So the answer would be 'yes' to that..
> i for one, think that the forward slash would total
> kick backward slash's *** in a fight.
Let's try shall we, since both are here already?
See them eye each other:
/\
Now they're testing their strength:
/ \
Oh, looks like an early end to that fight: Forward slash was actually a semi-colon in drag, causing backslash to faint:
; _
> Both in windows and Linux platform> we have to use forward slashNo, Windows does not recognize a forward slash in file paths. In Java, you can use forward slash even on Windows because the conversion to the actual path is a part of the internal implementation.