This sounds like an Eclipse-related question, which should be asked in the IDE forum Anyway, are you sure you're executing this class, and not another. Right-click the source, select Run As -> Java Application.
By "console" do you mean a command prompt? You know that Eclipse doesn't use the "java" program, but something called "javaw" which doesn't use the command prompt? I ran your class and got the requisite output on Eclipse.
In Eclipse, make sure the Console view is visible by selecting the menu Window / Show View / Console. Then run your application from Eclipse. The output should appear in the Console view inside Eclipse.