스레드 컨커런시 네트워크 - 복잡한 문제 대응
언어는 금방 배운다
코테는 프로그래머스로. 언어선택 가능
클라우드 중요함
mutable과 immutable
// before
// validCheck 함수를 거치며 원래의 start와 end 값이 변경될 수 있다.
public Period(Date start, Date end) {
validCheck(start, end);
this.start = start;
this.end = end;
}
// after (defensive copy)
// start와 end를 새로 할당받아 사용하기 때문에
// 기존의 start와 end의 값이 바뀌지 않는다.
public Period(Date start, Date end) {
this.start = new Date(start.getTime());
this.end = new Date(end.getTime());
validCheck(start, end);
}
// 하지만, defensive copy를 하였어도 내부 요소들이 mutable하다면
// 여전히 객체는 mutable하다.
public class Names {
private final List<Name> names;
public Names(List<Name> names) {
// defensive copy 했으나
this.names = new ArrayList<>(names);
}
}
public class Application {
public static void main(String[] args) {
Name crew1 = new Name("Fafi");
Name crew2 = new Name("Kevin");
List<Name> originalNames = new ArrayList<>();
originalNames.add(crew1);
originalNames.add(crew2);
Names crewNames = new Names(originalNames); // crewNames의 names: Fafi, Kevin
// 결국 내부 요소가 mutable하면 값 변경 가능함.
crew2.setName("Sally"); // crewNames의 names: Fafi, Sally 로 변함
// mutable한 객체를 만들려면, 아예 setter가 없어야 한다.
// mutable = '읽기 전용' 느낌
}
}int와 Integer의 차이?

// Integer
ArrayList<Integer> intList = new ArrayList<Integer>();
intList.add(1);
intList.add(2);
System.out.println(intList.get(0));
// int
String stringNum = "123";
int intNum = Integer.parseInt(stringNum);
System.out.println(intNum);
추상클래스
인터페이스 더 체계적, 더 많이 쓰인다
다형성
stream을 쓰는 이유
문자열 붙일 때 +로 붙이는거보다
System.exit(0);
null