Thursday Quiz
Think you know Java? Try this!
Without the aid of a Java compiler, can you tell if the following class will compile?
public class Foo {
{ Foo(); }
public Foo() {}
public void Foo() {}
public void Foo(Foo Foo) {}
public static void main(String[] args) {
Foo Foo = new Foo();
Foo.Foo(Foo);
}
}
Re: Thursday Quiz
that was originally what I was thinking. However, Foo() is a constructor and that IS legal to call in a static context.
Then I wasn't sure what the default return value of a constructor was. I would assume void, so the first two constructors would be conflicting.
Apparantly that's not true, though, because running it through a java compiler to test my theory that it would barf on the constructor conflict shows.. well, it shows that it doesn't barf there. :) Don't wanna spoil the answer for anyone else reading.