I am trying to implement my own File class, which extends from the java.io.File (please don’t judge me 🙂 and I am trying to be able to construct my class by giving the java.io.File instance as follows:
public class File extends java.io.File {
public File (String fileName) {
super(fileName);
}
public File (java.io.File file) {
// the problem
super = file;
}
...
}
My problem is that I would like to construct my class with something like super = file which is obviously an incorrect expression. Can you suggest how this could be done?
Thanks.
How about