기초
스스로 기초를 다지는 데 도움이 되는 공부 거리를 목차로 정리합니다. 큰 목차는 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 Java | Java Language Basics, Java Arrays | 2~3일 |
| 6.092: Introduction to Programming in Java | Lecture 1 ~ 3 | 3~5일 |
| Introduction to Programming in Java | Chapter 1 ~ 2 | 1~2주 |
Numbers & Strings #
int, double 같은 primitive type과 Integer, Double 같은 wrapper class, 그리고 String을 다루는 방법을 익힙니다.
| 선택 | 범위 | 시간 |
|---|---|---|
| Numbers and Strings | 전체 | 3~4일 |
| Baeldung | Wrapper Classes in Java | 1~2일 |
| Guide to the Number Class in Java | ||
| Get Started with Java의 Java Strings | 1~2일 |
StringUtils
java.lang.String을 보완·확장하는 StringUtils 속
null-safe method를 익힙니다.
| 단계 | 시간 |
|---|---|
| Introduction to Apache Commons Lang 3, 3. StringUtils | 1일 |
| String Processing with Apache Commons Lang 3 |
floating point
| 단계 | 시간 | 비고 |
|---|---|---|
| 9.1: Floating Point | 1~2일 | 0.3 == 0.1 + 0.1 + 0.1이 false인 이유를 모른다면 |
| Overflow and Underflow in Java | Classes & Objects와 Essential 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 Java | Java OOP | 2~3일 |
| 6.092: Introduction to Programming in Java | Lecture 4 | 1일 |
| Introduction to Programming in Java | Chapter 3 | 1주 |
| Classes and Objects → Interfaces and Inheritance | 전체 | 1주 |
object equality
두 object가 같은지 비교하는 방법을 익힙니다.
| 단계 | 시간 | 비고 |
|---|---|---|
| 15: Equality | 1~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 Java | Java Exceptions, Java I/O, Regular Expressions API | 3~4일 |
| Essential Java Classes | Exceptions, Basic I/O, Regular Expressions | 1주 |
null safety
null 값을 안전하게 다루는 방법을 익힙니다.
| 단계 | 시간 |
|---|---|
| Guide to Java Optional | 1일 |
| Avoid Check for Null Statement | |
| JSpecify and Null-Safety |
unit testing (검토 중)
| 단계 | 범위 | 시간 |
|---|---|---|
| JUnit 5 | JUnit - Testing Basics | 1~2일 |
| Mockito Series | Mockito Basics |
logging
| 자료 | 시간 |
|---|---|
| A Guide to Logback | 1일 |
Date/Time API
Java 8+의 java.time package로 날짜와 시간을 다루는 방법을 익힙니다.
| 자료 | 시간 |
|---|---|
| Introduction to the Java 8 Date/Time API | 1일 |
| Migrating to the New Java 8 Date Time API |
Collections #
List, Set, Map 따위 data structure 다루는 법을 익힙니다.
Generics
type을 parameter로 받아 type-safe & reusable code를 짜는 방법을 익힙니다.
| 선택 | 범위 | 시간 |
|---|---|---|
| Baeldung | The Basics of Java Generics | 2~3일 |
| Type Parameter vs Wildcard in Java Generics | ||
| < ? > vs. < ? extends Object > | ||
| Type Erasure in Java Explained | ||
| Generics | 전체 | 3~4일 |
| 선택 | 범위 | 시간 |
|---|---|---|
| Get Started with Java | Java Collections | 2~3일 |
| Collections | 전체 | 1주 |
Stream API
Java 8+의 java.util.stream package로 sequence of elements를 처리하는 방법을 익힙니다.
| 자료 | 시간 |
|---|---|
| Introduction to Java 8 Streams | 1일 |
| Guide to Java 8’s Collectors | 1일 |
Concurrency & Networking #
thread, socket, network - concurrency와 network programming을 익힙니다.
| 선택 | 범위 | 시간 |
|---|---|---|
| MIT 6.005: Software Construction | 19: Concurrency ~ 23: Locks & Synchronization | 2~3주 |
| Baeldung | Java Concurrency Basics | 1~2주 |
| Advanced Concurrency in Java | ||
| - | ||
| A Guide to Java Sockets | 2~3일 | |
| Read an InputStream using the Java Server Socket | ||
| A Guide to UDP In Java |
보충
| 자료 | 시간 |
|---|---|
| Connection Timeout vs. Read Timeout for Java Sockets | 1일 |
| A Guide to the Java URL → Difference Between URL and URI |
참고문헌 #
- Baeldung. Get Started with Java.
- Baeldung. JUnit 5.
- Eck, David J. Introduction to Programming Using Java, Version 9.0, JavaFX Edition, 2022.
- MIT OpenCourseWare. 6.005: Software Construction, Spring 2016.
- MIT OpenCourseWare. 6.092: Introduction to Programming in Java, January IAP 2010.
- Oracle. The Java Tutorials: Language Basics.
- Sedgewick, Robert & Kevin Wayne. Introduction to Programming in Java: An Interdisciplinary Approach, 2nd ed., Addison-Wesley, 2017.