why construct file with "", the path of the file return "/"?

Discussion in 'Java' started by junzhang1983@gmail.com, Feb 29, 2008.

  1. Guest

    l am a little puzzled, why the file's behavior like this:

    File fl = new File("","1.txt");
    System.out.println(fl.getName());
    System.out.println(fl.getParent());
    System.out.println(fl.getPath());
    System.out.println(fl.getAbsolutePath());
    try {
    System.out.println(fl.getCanonicalPath());
    } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }
     
    , Feb 29, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mr. SweatyFinger

    why why why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    938
    Mark Rae
    Dec 21, 2006
  2. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,138
    Smokey Grindel
    Dec 2, 2006
  3. Replies:
    1
    Views:
    284
    Knute Johnson
    Feb 29, 2008
  4. Replies:
    0
    Views:
    316
  5. Mukesh
    Replies:
    4
    Views:
    640
    Paul N
    Mar 26, 2010
Loading...

Share This Page