public class DataSetTester3
{
public static void main(String[] args)
{
class RectangleMeasurer implements Measurer
{
. . .
}
Measurer m = new RectangleMeasurer();
DataSet data = new DataSet(m);
. . .
}
}
If inner class is defined inside an enclosing class, but outside its methods, it is available to all methods of enclosing class
Compiler turns an inner class into a regular class file:
DataSetTester$1$RectangleMeasurer.class