Whilst working through a
Java tutorial I noticed that the File class has a default method
i.e.
File myFile = new File("c:/dir1/myfile.txt");
System.out.println("My file is " + myFile);
displays
My file is c:\dir1\myfile.txt
Presumably toString() is the "default" method for the File class.
Q1. Do all classes have "default" methods?
Q2. As all class inherit from Object is toString() always the "default" method?
Q3. If not how do you specify a "default" method.
Mike Dennison
slightly confused in Woodford Green
