Ask coding questions

← Back to all posts
How do I fix "exit compiler status 1" error?
SHANEKASNER (1)


Answered by Coder100 (16879) [earned 5 cycles]
View Answer
Comments
hotnewtop
Coder100 (16879)

Your class is named wrong. It has to be called Main because that's what the file name is called.

DynamicSquid (4627)

also for your "bruh" file, you might wanna add the java extension to it: "bruh.java"

DynamicSquid (4627)

You can't have a "public" class

public class RectangleArea
{
	public static void main(String[] args) {
		int length=14;
		int width=16;
		int area;
		area=length*width;
		System.out.print(area);
	}
}

get rid of the "public class" and only put "class". public can only be used for methods