-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
AssignmentSomething to submitSomething to submit
Description
아래 코드를 enum 과 인스턴스 필드를 사용하여 중복을 제거 해 봅시다.
class Distance{
private int east;
private int west;
private int north;
private int south;
public void setEast(int east){ this.east = east; }
public void setWest(int west){ this.west = west; }
public void setNorth(int north){ this.north = north; }
public void setSouth(int south){ this.south = south; }
public int getEast() { return east; }
public int getWest() { return west; }
public int getNorth() { return north; }
public int getSouth() { return south; }
}
출처: https://effectiveprogramming.tistory.com/entry/enum-을-배열의-인덱스로-활용하는-방법
dolly0920
Metadata
Metadata
Assignees
Labels
AssignmentSomething to submitSomething to submit