I kind of agree that methods shouldn’t have to be part of a class, but how are you going to call them from other classes? Let’s say I have the file MyFile.java that contains the method void myMethod() that isn’t in a class. When I import MyFile, do I just call it as myMethod()? I wouldn’t want to get it confused with a class (or, even worse, another classless file) that happened to contain another myMethod() method.
I guess you could do something like make each “free” method name start with #, a character that isn’t used elsewhere in Java. That would separate all such methods from class methods, but not resolve naming conflicts with eachother.
I kind of long for a Java-ish version of delegates, one of the few features of C# I actually like. I want to be able to implement interfaces in a delegate-ish way, but I don’t want to pass a bunch of method pointers around to use willy-nilly.
