V
vbhelpski
Having a hard time understanding this behavior
File(".")
File("/")
Given the File object above, output of ":::" + x.getName() + ":::" is
:::.:::
::::::
How does this definition of getName() prepare me for
the above output? If '/' is special in that it is the
'separator character', then how would one obtain the name
of the root? getParent() tells me if I have a root name -
it throws.
thanks
getName
public String getName()Returns the name of the file or directory
denoted by this abstract pathname. This is just the last name in the
pathname's name sequence. If the pathname's name sequence is empty,
then the empty string is returned.
Returns:
The name of the file or directory denoted by this abstract pathname, or
the empty string if this pathname's name sequence is empty
File(".")
File("/")
Given the File object above, output of ":::" + x.getName() + ":::" is
:::.:::
::::::
How does this definition of getName() prepare me for
the above output? If '/' is special in that it is the
'separator character', then how would one obtain the name
of the root? getParent() tells me if I have a root name -
it throws.
thanks
getName
public String getName()Returns the name of the file or directory
denoted by this abstract pathname. This is just the last name in the
pathname's name sequence. If the pathname's name sequence is empty,
then the empty string is returned.
Returns:
The name of the file or directory denoted by this abstract pathname, or
the empty string if this pathname's name sequence is empty