class Hello {
public static void main(String[] args) {
System.out.println("Hello world");
}
}
자바의 클래스(class)는 위의 코드처럼 대문자로 시작해야합니다.
그리고 자바는 대문자와 소문자를 구분하기 때문에 hello와 Hello는 다른 문자입니다.
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
at Hello.main(Hi.java:2)
자바의 어플리케이션은 파일의 이름과 클래스의 이름이 같아야합니다.
만약 파일 이름과 클래스 이름이 다를 경우 위와 같은 오류가 발생하니 주의해야 합니다.
출처
W3Schools.com
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
www.w3schools.com
'Programming > Java' 카테고리의 다른 글
연산자(Operators) (0) | 2024.08.01 |
---|---|
Java 변수의 형변환 (0) | 2024.07.28 |
Java 변수 (0) | 2024.07.27 |
Java 주석 처리 (0) | 2024.07.27 |
Java의 입출력 (0) | 2024.07.27 |