Skip to content
Java Book
Search
Ctrl
K
Cancel
GitHub
Select language
English
Français
1 - Introduction toJava
1.1 History and evolution ofJava
1.2 Java philosophy (write once, run anywhere)
1.3 InstallingJava (JDK, JRE, JVM)
1.4 Setting up your development environment (intellij, eclipse, vs code)
1.5 Your firstJava program
1.6 Compiling and runningJava programs (javac,Java)
1.7 Understanding theJava platform (JVM, bytecode)
1.8 Java editions (SE, EE, ME)
1.9 Java version history and features
2 - Variables and primitive data types
2.1 Variables and identifiers
2.2 Primitive data types
2.2.1 Integer types (byte, short, int, long)
2.2.2 Floating‑point types (float, double)
2.2.3 Character type (char)
2.2.4 Boolean type (boolean)
2.3 Literals and constants (final)
2.4 Type conversion and casting
2.4.1 Implicit (widening) conversion
2.4.2 Explicit (narrowing) casting
2.5 Variable scope and lifetime
2.6 Default values of primitives
2.7 Wrapper classes (integer, double, boolean, etc.) and autoboxing/unboxing
3 - Operators and expressions
3.1 Arithmetic operators
3.2 Assignment operators
3.3 Relational operators
3.4 Equality operators
3.5 Logical operators
3.6 Bitwise operators
3.7 Ternary operator
3.8 Unary operators
3.9 Operator precedence and associativity
3.10 String concatenation
4 - Control flow
4.1 Conditional statements
4.1.1 If, else if, else
4.1.2 Nested if
4.1.3 Switch statement (traditional and enhanced with arrows, yield)
4.1.4 Ternary operator
4.2 Loops
4.2.1 For loop (traditional)
4.2.2 Enhanced for loop (for‑each)
4.2.3 While loop
4.2.4 Do‑while loop
4.3 Loop control (break, continue, labeled statements)
4.4 The break and continue with labels
5 - Classes and objects
5.1 Defining classes (class)
5.2 Fields (instance variables)
5.3 Methods (instance methods)
5.4 Constructors
5.4.1 Default constructor
5.4.2 Parameterized constructors
5.4.3 Constructor overloading
5.4.4 Copy constructors
5.5 The this keyword
5.6 The new keyword and object creation
5.7 Access modifiers (public, protected, default, private)
5.8 Static members (static fields, static methods, static blocks)
5.9 Final keyword (final variables, methods, classes)
5.10 Garbage collection and finalize() method
5.11 Object lifecycle
6 - Methods deep dive
6.1 Method signature and overloading
6.2 Passing parameters (pass‑by‑value)
6.3 Varargs (variable‑length arguments)
6.4 Returning values
6.5 Recursion
6.5.1 Base case and recursive case
6.5.2 Recursion vs iteration
6.6 Method hiding (static methods)
6.7 Native methods (native keyword)
7 - Inheritance and polymorphism
7.1 Extending classes (extends)
7.2 The object class and its methods (tostring, equals, hashcode, clone, finalize)
7.3 Overriding methods (@override)
7.4 The super keyword
7.5 Polymorphism (compile‑time vs runtime)
7.6 Dynamic method dispatch
7.7 Abstract classes and methods (abstract)
7.8 Final classes and methods
7.9 Inheritance and constructors (super() call)
8 - Interfaces
8.1 Defining interfaces (interface)
8.2 Implementing interfaces (implements)
8.3 Multiple inheritance via interfaces
8.4 Default methods (default)
8.5 Static methods in interfaces
8.6 Private methods in interfaces (java 9+)
8.7 Functional interfaces and @functionalinterface
8.8 Marker interfaces (serializable, cloneable)
9 - Packages and imports
9.1 Creating packages (package)
9.2 Importing classes (import)
9.3 Static imports (import static)
9.4 Package access and protection
9.5 Creating jar files
9.6 Module system (java 9+)
9.6.1 Module‑info.java
9.6.2 Module dependencies and exports
10 - Strings and string handling
10.1 String class (immutable)
10.2 String methods (charat, length, substring, indexof, replace, split, etc.)
10.3 String comparison (equals, equalsignorecase, compareto)
10.4 Stringbuilder and stringbuffer (mutable strings)
10.5 String joiner and string.join
10.6 String tokenizer
10.7 Regular expressions (java.util.regex)
10.7.1 Pattern and matcher
10.7.2 Regex syntax
10.7.3 Groups and flags
11 - Arrays
11.1 Declaring and creating arrays
11.2 Accessing array elements
11.3 Array length
11.4 Multidimensional arrays
11.5 Copying arrays (system.arraycopy, arrays.copyof)
11.6 Arrays utility class (java.util.arrays)
11.6.1 Sorting (sort, parallelsort)
11.6.2 Searching (binarysearch)
11.6.3 Filling (fill)
11.6.4 Comparing (equals, deepequals)
11.6.5 Converting to list (aslist)
11.7 Jagged arrays
12 - Enum types
12.1 Defining enums (enum)
12.2 Enum constants and fields
12.3 Enum methods (values, valueof, ordinal)
12.4 Enums with constructors and methods
12.5 Enumset and enummap
12.6 Using enums in switch statements
13 - Date and time API (java.time)
13.1 Legacy date and calendar (java.util.date,Java.util.calendar)
13.2 New date/time API (java 8+)
13.2.1 Localdate, localtime, localdatetime
13.2.2 Zoneddatetime, offsetdatetime
13.2.3 Instant and duration
13.2.4 Period
13.2.5 Formatting and parsing (datetimeformatter)
13.2.6 Temporal adjusters
13.3 Working with time zones (zoneid, zoneoffset)
14 - Collections overview
14.1 Collection framework hierarchy
14.2 Iterable and iterator
14.3 Collection interface
14.4 Generics in collections
14.5 Legacy classes (vector, stack, hashtable, enumeration)
15 - List interface
15.1 Arraylist
15.1.1 Creating arraylist
15.1.2 Adding and removing elements
15.1.3 Iteration and listiterator
15.1.4 Sorting (collections.sort, list.sort)
15.2 Linkedlist
15.2.1 Linkedlist as list and deque
15.2.2 Methods specific to linkedlist
15.3 Vector and stack
15.4 Copyonwritearraylist (concurrent)
16 - Set interface
16.1 Hashset
16.1.1 Hashing and hashcode()
16.1.2 Performance considerations
16.2 Linkedhashset (insertion order)
16.3 Treeset (sortedset)
16.3.1 Comparable and comparator
16.3.2 Navigableset methods
16.4 Enumset
16.5 Copyonwritearrayset
17 - Queue and deque interfaces
17.1 Queue interface
17.1.1 Linkedlist as queue
17.1.2 Priorityqueue
17.1.3 Arraydeque
17.2 Deque interface
17.2.1 Operations at both ends
17.2.2 Stack using deque
17.3 Blockingqueue (concurrent)
17.3.1 Arrayblockingqueue, linkedblockingqueue
17.3.2 Priorityblockingqueue
17.3.3 Delayqueue, synchronousqueue
18 - Map interface
18.1 Hashmap
18.1.1 Working with hashmap
18.1.2 Load factor and rehashing
18.2 Linkedhashmap (insertion order, access order)
18.3 Treemap (sortedmap)
18.3.1 Comparable and comparator
18.3.2 Navigablemap methods
18.4 Hashtable (legacy)
18.5 Enummap
18.6 Weakhashmap
18.7 Identityhashmap
18.8 Concurrenthashmap and concurrentmap
19 - Utility classes
19.1 Collections class
19.1.1 Sorting, searching, reversing, shuffling
19.1.2 Synchronized wrappers
19.1.3 Unmodifiable wrappers
19.1.4 Utility methods (frequency, disjoint, addall, etc.)
19.2 Arrays class (covered in chapter 11)
19.3 Objects class (null‑safe methods, hash, tostring)
20 - Exceptions and assertions
20.1 Exception hierarchy (throwable, error, exception)
20.2 Checked vs unchecked exceptions
20.3 Try‑catch‑finally block
20.4 Try‑with‑resources (autocloseable)
20.5 Multiple catch blocks
20.6 The throw and throws keywords
20.7 Creating custom exceptions
20.8 Chained exceptions
20.9 Assertions (assert)
20.10 Best practices for exception handling
21 - File i/o (java.IO)
21.1 The file class
21.2 Byte streams (inputstream, outputstream, fileinputstream, fileoutputstream)
21.3 Character streams (reader, writer, filereader, filewriter)
21.4 Buffered streams (bufferedreader, bufferedwriter)
21.5 Printstream and printwriter
21.6 Data streams (datainputstream, dataoutputstream)
21.7 Object streams (objectinputstream, objectoutputstream) and serialization
21.8 Transient keyword
21.9 Externalizable interface
22 - NIO and NIO.2 (java.NIO)
22.1 Path interface and paths class
22.2 Files class (read, write, copy, move, delete, walk, find)
22.3 File systems and file stores
22.4 Buffers (bytebuffer, charbuffer)
22.5 Channels (filechannel, socketchannel, serversocketchannel)
22.6 Selectors and non‑blocking i/o
22.7 Asynchronous file i/o (asynchronousfilechannel)
22.8 Watch service (file change monitoring)
23 - Serialization and deserialization
23.1 Serializable interface
23.2 Serialversionuid
23.3 Custom serialization (writeobject, readobject)
23.4 Externalizable interface
23.5 JSON and XML processing (jackson, jaxb)
24 - Threads and runnables
24.1 Creating threads (thread class, runnable interface)
24.2 Thread lifecycle (new, runnable, blocked, waiting, timed waiting, terminated)
24.3 Thread methods (start, join, sleep, yield, interrupt)
24.4 Daemon threads
24.5 Thread priorities
24.6 Thread groups
25 - Synchronization and locks
25.1 Race conditions and critical sections
25.2 Synchronized methods and blocks
25.3 Intrinsic locks (monitors)
25.4 Volatile keyword
25.5 Deadlock, livelock, and starvation
25.6 Java.util.concurrent.locks package
25.6.1 Lock, reentrantlock
25.6.2 Readwritelock, reentrantreadwritelock
25.6.3 Stampedlock
25.7 Condition objects
26 - High‑level concurrency utilities
26.1 Executor framework
26.1.1 Executor, executorservice, scheduledexecutorservice
26.1.2 Threadpoolexecutor, scheduledthreadpoolexecutor
26.1.3 Executors factory methods
26.1.4 Callable and future
26.1.5 Completionservice and executorcompletionservice
26.2 Fork/join framework (forkjoinpool, recursivetask, recursiveaction)
26.3 Concurrent collections (concurrenthashmap, copyonwritearraylist, blockingqueue implementations)
26.4 Atomic variables (java.util.concurrent.atomic)
26.5 Synchronizers (countdownlatch, cyclicbarrier, semaphore, phaser, exchanger)
27 - Java memory model and thread safety
27.1 Java memory model (jmm)
27.2 Happens‑before relationship
27.3 Immutable objects
27.4 Threadlocal variables
27.5 Thread safety strategies
28 - Lambda expressions
28.1 Introduction to lambdas
28.2 Syntax and types (functional interfaces)
28.3 Method references (class::staticmethod, instance::method, class::new)
28.4 Built‑in functional interfaces (java.util.function)
28.4.1 Predicate, function, consumer, supplier
28.4.2 Primitive specializations (intpredicate, etc.)
28.5 Variable capture (effectively final)
29 - Stream API
29.1 Creating streams (from collections, arrays, files, stream.of, generate, iterate)
29.2 Intermediate operations
29.2.1 Filter, map, flatmap, distinct, sorted, peek, limit, skip
29.3 Terminal operations
29.3.1 Foreach, toarray, reduce, collect, min, max, count, anymatch, allmatch, nonematch, findfirst, findany
29.4 Collectors (tolist, toset, tomap, groupingby, partitioningby, joining, summarizingint, etc.)
29.5 Parallel streams
29.6 Stream performance considerations
29.7 Primitive streams (intstream, longstream, doublestream)
30 - Optional class
30.1 What is optional?
30.2 Creating optionals (of, ofnullable, empty)
30.3 Optional methods (ispresent, ifpresent, orelse, orelseget, oreelsethrow, map, flatmap, filter)
30.4 Best practices (avoid using optional for fields, serialization, etc.)
31 - Reflection
31.1 The class object and class loading
31.2 Inspecting classes (getfields, getmethods, getconstructors, getdeclaredfields, etc.)
31.3 Accessing private members (setaccessible)
31.4 Dynamic invocation (method.invoke)
31.5 Creating instances dynamically (newinstance)
31.6 Arrays via reflection
31.7 Reflection and performance
32 - Annotations
32.1 What are annotations?
32.2 Built‑in annotations (@override, @deprecated, @suppresswarnings, @functionalinterface)
32.3 Meta‑annotations (@retention, @target, @inherited, @documented)
32.4 Creating custom annotations
32.5 Processing annotations at runtime (reflection)
32.6 Annotation processing at compile time (abstractprocessor)
33 - Generics deep dive
33.1 Type parameters and type arguments
33.2 Generic classes and interfaces
33.3 Generic methods and constructors
33.4 Bounded type parameters (extends)
33.5 Wildcards (?, ? extends t, ? super t)
33.6 Type erasure and bridge methods
33.7 Restrictions on generics
33.8 Wildcard capture and helper methods
34 - Modules (java platform module system)
34.1 Introduction to modules
34.2 Module‑info.java (module, exports, requires, opens, provides, uses)
34.3 Modular jars
34.4 Service loader pattern (provides ... with ..., serviceloader)
34.5 Migration and unnamed modules
35 - JVM internals and performance
35.1 JVM architecture (class loader, runtime data areas, execution engine)
35.2 Garbage collection
35.2.1 Gc algorithms (mark‑sweep, copying, mark‑compact)
35.2.2 Generational gc
35.2.3 Gc implementations (serial, parallel, cms, g1, zgc, shenandoah)
35.3 JVM tuning (heap size, gc logging, etc.)
35.4 Bytecode and class file structure
35.5 Just‑in‑time (jit) compilation
35.6 Profiling and monitoring (jconsole, jvisualvm,Java flight recorder, mission control)
36 - Security
36.1 Java security model (sandbox, permissions)
36.2 Class loaders and security
36.3 Security manager (deprecated) and policy files
36.4 Cryptography (java.security, jca, jce)
36.5 Ssl/tls (javax.net.ssl)
36.6 Authentication and authorization (jaas)
36.7 Secure coding guidelines (input validation, escaping, SQL injection prevention)
37 - Internationalization (i18n)
37.1 Locale class
37.2 Resourcebundle and properties files
37.3 Number and currency formatting (numberformat)
37.4 Date and time formatting (dateformat, datetimeformatter)
37.5 Messageformat and choiceformat
37.6 Unicode and character encoding
38 - Networking
38.1 Socket programming (java.net.socket, serversocket)
38.2 URL and urlconnection (httpurlconnection)
38.3 Datagram sockets (udp)
38.4 Inetaddress
38.5 HTTP client (java 11+)
38.5.1 Httpclient, httprequest, httpresponse
38.5.2 Synchronous and asynchronous requests
38.5.3 HTTP/2 support
38.6 Rmi (remote method invocation) – overview
39 - Database access (JDBC)
39.1 JDBC architecture
39.2 Connecting to a database (drivermanager, datasource)
39.3 Statement, preparedstatement, callablestatement
39.4 Resultset and rowset
39.5 Transactions (commit, rollback, savepoints)
39.6 Connection pooling (hikaricp, etc.)
39.7 Orm frameworks (jpa, hibernate) – overview
40 - Java for enterprise (overview)
40.1 Servlets and jsp
40.2 Spring framework (core, boot, mvc)
40.3 Java ee / jakarta ee (ejb, jms, cdi, jta)
40.4 Microservices (spring cloud, micronaut, quarkus)
40.5 Build tools (maven, gradle)
41 - Unit testing with junit
41.1 Junit 5 (jupiter)
41.2 Test lifecycle (@beforeeach, @aftereach, @beforeall, @afterall)
41.3 Assertions (assertequals, asserttrue, assertthrows, etc.)
41.4 Assumptions (assumetrue)
41.5 Parameterized tests
41.6 Repeated tests
41.7 Test suites
41.8 Mocking with mockito
41.8.1 Creating mocks
41.8.2 Stubbing and verification
41.8.3 Argument matchers
42 - Debugging and logging
42.1 Debugging with ides (breakpoints, step over/into, evaluate)
42.2 Logging frameworks (java.util.logging, log4j, slf4j, logback)
42.3 Configuration and appenders
42.4 Best practices for logging
42.5 Using jdb (java debugger)
43 - Code quality and linting
43.1 Coding conventions (java code conventions)
43.2 Static analysis tools (checkstyle, pmd, spotbugs)
43.3 Code formatters (intellij formatter, eclipse formatter)
43.4 Linting in ides
43.5 Continuous integration (jenkins, github actions)
44 - Design patterns inJava
44.1 Creational patterns
44.1.1 Singleton (classic and enum‑based)
44.1.2 Factory method
44.1.3 Abstract factory
44.1.4 Builder
44.1.5 Prototype
44.2 Structural patterns
44.2.1 Adapter
44.2.2 Decorator
44.2.3 Proxy (dynamic proxies)
44.2.4 Facade
44.2.5 Bridge
44.2.6 Composite
44.2.7 Flyweight
44.3 Behavioral patterns
44.3.1 Observer (observable, observer – deprecated, propertychangelistener)
44.3.2 Strategy
44.3.3 Command
44.3.4 Template method
44.3.5 Iterator
44.3.6 Mediator
44.3.7 Memento
44.3.8 State
44.3.9 Visitor
44.3.10 Chain of responsibility
45 - Java memory leaks and profiling
45.1 Common memory leak patterns
45.2 Using visualvm, jprofiler, yourkit
45.3 Heap dumps and analysis (eclipse memory analyzer)
45.4 Garbage collection logs analysis
45.5 Thread dumps and deadlock detection
GitHub
Select language
English
Français
predicate, function, consumer, supplier