기초

스스로 기초를 다지는 데 도움이 되는 공부 거리를 목차로 정리합니다. 큰 목차는 MIT 6.005의 2: Basic Java와 거의 같습니다.

일러두기
  • 학습 시간은 하루 2~3시간. code 돌려보고 문제 푸는 것까지 포함해서.
  • Get Started with Java: Java 입문자에게 알맞은 짧은 글 모음. baelding 글은 대체로 군더더기 적고 골라 읽기 편하고 바로 써먹기 좋다.
  • MIT 6.092: 강의 slide와 예제 code. programming 입문자에게 알맞다.
  • MIT 6.005: software 설계 원칙과 기법. (MIT 6.092 수준으로) 프로그램 짜는 기초를 닦은 뒤 읽으면 좋다.
  • Introduction to Programming in Java: 수학·과학 예제가 풍부한 컴퓨터 과학 교과서

Language Basic #

타입, 변수, 연산자, 조건문, 반복문, 배열 - 프로그래밍의 기본 구성 요소를 익힙니다. build tool: 처음부터 Maven이나 Gradle로 project를 만들어 연습하면 dependency 관리와 project 구조에 익숙해집니다. logging: System.out.println 대신 SLF4J를 쓰는 습관을 들이면 좋습니다.

선택범위시간
Get Started with JavaJava Language Basics, Java Arrays2~3일
6.092: Introduction to Programming in JavaLecture 1 ~ 33~5일
Introduction to Programming in JavaChapter 1 ~ 21~2주
test-first programming

일찍부터 test를 작성하는 습관을 들이면 좋습니다.

단계시간
JUnit 5 @Test Annotation1일
JUnit 5 Assertions

Numbers & Strings #

int, double 같은 primitive type과 Integer, Double 같은 wrapper class, 그리고 String을 다루는 방법을 익힙니다.

선택범위시간
Numbers and Strings전체3~4일
BaeldungWrapper Classes in Java1~2일
Guide to the Number Class in Java
Get Started with Java의 Java Strings1~2일
StringUtils

java.lang.String을 보완·확장하는 StringUtils 속 null-safe method를 익힙니다.

단계시간
Introduction to Apache Commons Lang 3, 3. StringUtils1일
String Processing with Apache Commons Lang 3
floating point
단계시간비고
9.1: Floating Point1~2일0.3 == 0.1 + 0.1 + 0.1false인 이유를 모른다면
Overflow and Underflow in JavaClasses & ObjectsEssential Java Classes를 먼저 읽으면 이해하기 수월함
Comparing Doubles in Java

Classes & Objects #

Implementation inheritance (subclassing). … The idea is to define a new class (subclass, or derived class) that inherits instance variables (state) and instance methods (behavior) from another class (superclass, or base class), enabling code reuse. … we avoid subclassing because it works against encapsulation and immutability (e.g., the fragile base class problem and the circle–ellipse problem).

class, interface, object, method, field, extends, implements - Java에서 abstract data type의 표현 수단을 익힙니다. boilerplate code: Lombok의 annotation으로 getter, setter, toString(), equals(), hashCode() 같이 거의 되풀이 되는 code 뿐 아니라, @NonNull로 null check code를 요약할 수 있습니다.

선택범위시간
Get Started with JavaJava OOP2~3일
6.092: Introduction to Programming in JavaLecture 41일
Introduction to Programming in JavaChapter 31주
Classes and ObjectsInterfaces and Inheritance전체1주
object equality

두 object가 같은지 비교하는 방법을 익힙니다.

단계시간비고
15: Equality1~2일예제와 함께 읽으면 이해가 빠름
Difference Between == and equals() in Java
Java equals() and hashCode() Contracts
Guide to hashCode() in Java
Comparing Objects in Java
Compare Strings in Java

Essential Java Classes #

예외 처리, 입출력, 정규표현식 - 자주 쓰는 class를 익힙니다. Apache Commons IO: IOUtils, FileUtils로 파일과 스트림을 간편하게 다룰 수 있습니다.

선택범위시간
Get Started with JavaJava Exceptions, Java I/O, Regular Expressions API3~4일
Essential Java ClassesExceptions, Basic I/O, Regular Expressions1주
null safety

null 값을 안전하게 다루는 방법을 익힙니다.

단계시간
Guide to Java Optional1일
Avoid Check for Null Statement
JSpecify and Null-Safety
unit testing (검토 중)
단계범위시간
JUnit 5JUnit - Testing Basics1~2일
Mockito SeriesMockito Basics
logging
자료시간
A Guide to Logback1일
Date/Time API

Java 8+의 java.time package로 날짜와 시간을 다루는 방법을 익힙니다.

자료시간
Introduction to the Java 8 Date/Time API1일
Migrating to the New Java 8 Date Time API

Collections #

List, Set, Map 따위 data structure 다루는 법을 익힙니다.

Generics

type을 parameter로 받아 type-safe & reusable code를 짜는 방법을 익힙니다.

선택범위시간
BaeldungThe Basics of Java Generics2~3일
Type Parameter vs Wildcard in Java Generics
< ? > vs. < ? extends Object >
Type Erasure in Java Explained
Generics전체3~4일
선택범위시간
Get Started with JavaJava Collections2~3일
Collections전체1주
Stream API

Java 8+의 java.util.stream package로 sequence of elements를 처리하는 방법을 익힙니다.

자료시간
Introduction to Java 8 Streams1일
Guide to Java 8’s Collectors1일
Google Guava (검토 중)

Collections 확장, Preconditions, caching 등 유용한 utility를 익힙니다.

자료시간
Guava Guide1일

Concurrency & Networking #

thread, socket, network - concurrency와 network programming을 익힙니다.

선택범위시간
MIT 6.005: Software Construction19: Concurrency ~ 23: Locks & Synchronization2~3주
BaeldungJava Concurrency Basics1~2주
Advanced Concurrency in Java
-
A Guide to Java Sockets2~3일
Read an InputStream using the Java Server Socket
A Guide to UDP In Java
보충
자료시간
Connection Timeout vs. Read Timeout for Java Sockets1일
A Guide to the Java URLDifference Between URL and URI

참고문헌 #