자바에서 클래스는 속성을 표현하는 필드(field)와 기능을 표현하는 메소드(method)로
구성되어 있다. 또한 생성된 객체의 필드를 초기화하는 생성자를 포함하고 있다.
public class SquidGame { //클래스
public static final String title = "SquidGame"; //필드
static int people = 456;
public static void main(String[] args) { //메서드
Game firstGame = new Game();
int people = firstGame.playGame();
System.out.println(people);
}
}
class Game {
int playGame() {
int winner = (SquidGame.people)-10;
return winner;
}
}