📁 ex01
☕ Slime.java
public class Slime {
double hp = 50;
int attack = 8;
double defense = 0.2;
void attack (Slime enemy) { // 💡 다른 슬라임의 인스턴스를 인자로 받음
enemy.hp -= attack * (1 - enemy.defense);
}
}
☕ Main.java
Slime slime1 = new Slime();
Slime slime2 = new Slime();
slime1.attack(slime2);