Can I set the default arument value in Construct function something like ?
public class XLSReader {
public XLSReader(String filename="XYZ.xls") {
}
}
No you cannot but what you can do is to have 2 constructors like this:
public class XLSReader {
String filename;
// constructor with a filename argument
public XLSReader(String filename) {
this.filename = filename;
}
// default constructor will fill-in "default value" XYZ.xls
public XLSReader() {
this.filename = "XYZ.xls";
}
}