3 ms·
I tried to run this: public class Foo { public static void main(String[] args) { System.out.println("foo"); } } And got an error "class Foo should be in a
by warmfuzzykitten 15y ago
I tried to run this:
public class Foo {
public static void main(String[] args) {
System.out.println("foo");
}
}
And got an error "class Foo should be in a file named Foo.java". Sweet!
Syntax highlighting doesn't seem to do anything. Isn't it a little grand to be calling this an IDE?
- reverend_gonzo 15y agoIf you name the class 'Main' it works fine. They have an "insert template" button which kind of clarifies that.
- swGooF 15y agoDon't specify the class as public. Then you can name it whatever you want.