Példa
public
static
void
main(
String
[] args) {
if
( args.length >
2
) {
File
f =
new
File( args[
0
] +
"/"
+ args[
1
] );
//$NON-NLS-1$
System.out.println( f.getAbsolutePath() );
}
}
Megoldás
Használja inkább a java.io.File.separator osztályt.
public
static
void
main(
String
[] args) {
if
( args.length >
2
) {
File
f =
new
File( args[
0
] + File.separator + args[
1
] );
System.out.println( f.getAbsolutePath() );
}
}