TIP/Java8 [Java] 가위바위보 게임 practice A program that plays the scissor-rock-paper game. A program randomly generates a number 0, 1, or 2 representing scissors, rock, and paper. The program prompts the user to enter a number 0, 1, or 2 and displays a message indicating whether the user or the computer wins, loses, or draws. Let the user continuously play until either the user or the computer wins two times more than their opponent (e.. 2023. 3. 9. Java error in BOj public class Main { public static void main(String[] args) { } } 위와 같은 형식을 따르지 않고 임의로 class 이름을 변경하는 실수를 하면 error가 뜬다. 이외에 몇가지 에러 요소에 대해 알아보자. 1. public static void main(String[] args)에서 void 대신 int 나 double등 다른 data type으로 작성한 경우 런타임 에러가 발생한다. 2. public static void main(String[] args)에서 static 이 빠지면 런타임 에러가 발생한다. 3. public static void main(String[] args)에서 main이 아닐 경우 에러가 발생한다. package를 사용하면 ma.. 2023. 3. 2. 이전 1 2 3 다음