class Link extends File { File physical_file; // constructor Link(File aFile, String name) { super(aFile.getParentDir(), name); physical_file = aFile; } public CompoundFile getDir(){ return physical_file.getDir(); } // override the getLink() method in the super class public Link getLink() { return this; } } // end of class Link