This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CupcakeMachine { | |
// Instance variables - each machine gets its own set | |
private int numCupcakes; | |
private double costPerCupcake; | |
private int orderNumber; | |
/** | |
* Constructs a new CupcakeMachine. | |
* @param initialCupcakes The number of cupcakes the machine is stocked with[cite: 7]. | |
* @param cost The cost per cupcake[cite: 9]. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** https://g.co/gemini/share/aa6d78a428cf | |
* 게임 캐릭터를 표현하는 클래스입니다. | |
* 이 클래스는 다양한 형태의 메서드를 통해 객체의 행동을 정의합니다. | |
*/ | |
public class GameCharacter { | |
// --- 1. 인스턴스 변수 (Instance Variables) --- | |
// 캐릭터의 핵심 데이터. private으로 외부의 직접적인 수정을 막습니다. | |
private String name; | |
private int hp; |