Java Notes for Professionals book

    Amazing collection of free programming books

    收集中
    免费
    Amazing collection of free programming books

    The Notes for Professionals book is compiled from Stack Overflow Documentation, the content is written by the beautiful people at Stack Overflow. Text content is released under Creative Commons BY-SA. See credits at the end of this book whom contributed to the various chapters. Images may be copyright of their respective owners unless otherwise specified

    Book created for educational purposes and is not affiliated with group(s), company(s) nor Stack Overflow. All trademarks belong to their respective company owners

    https://goalkicker.com/

    章节目录

    • 1-1
      Content list
    • 1-2
      About
    • 1-3
      Chapter 1: Getting started with Java Language
    • 1-4
      Section 1.1: Creating Your First Java Program
    • 1-5
      Chapter 2: Type Conversion
    • 1-6
      Section 2.1: Numeric primitive casting
    • 1-7
      Section 2.2: Basic Numeric Promotion
    • 1-8
      Section 2.3: Non-numeric primitive casting
    • 1-9
      Section 2.4: Object casting
    • 1-10
      Section 2.5: Testing if an object can be cast using instanceof
    • 1-11
      Chapter 3: Getters and Setters
    • 1-12
      Section 3.1: Using a setter or getter to implement a constraint
    • 1-13
      Section 3.2: Why Use Getters and Setters?
    • 1-14
      Section 3.3: Adding Getters and Setters
    • 1-15
      Chapter 4: Reference Data Types
    • 1-16
      Section 4.1: Dereferencing
    • 1-17
      Section 4.2: Instantiating a reference type
    • 1-18
      Chapter 5: Java Compiler - 'javac'
    • 1-19
      Section 5.1: The 'javac' command - getting started
    • 1-20
      Section 5.2: Compiling for a dierent version of Java
    • 1-21
      Chapter 6: Documenting Java Code
    • 1-22
      Section 6.1: Building Javadocs From the Command Line
    • 1-23
      Section 6.2: Class Documentation
    • 1-24
      Section 6.3: Method Documentation
    • 1-25
      Section 6.4: Package Documentation
    • 1-26
      Section 6.5: Links
    • 1-27
      Section 6.6: Code snippets inside documentation
    • 1-28
      Section 6.7: Field Documentation
    • 1-29
      Section 6.8: Inline Code Documentation
    • 1-30
      Chapter 7: Command line Argument Processing
    • 1-31
      Section 7.1: Argument processing using GWT ToolBase
    • 1-32
      Section 7.2: Processing arguments by hand
    • 1-33
      Chapter 8: The Java Command - 'java' and 'javaw'
    • 1-34
      Section 8.1: Entry point classes
    • 1-35
      Section 8.2: Troubleshooting the 'java' command
    • 1-36
      Section 8.3: Running a Java application with library dependencies
    • 1-37
      Section 8.4: Java Options
    • 1-38
      Section 8.5: Spaces and other special characters in arguments
    • 1-39
      Section 8.6: Running an executable JAR file
    • 1-40
      Section 8.7: Running a Java applications via a "main" class
    • 1-41
      Chapter 9: Literals
    • 1-42
      Section 9.1: Using underscore to improve readability
    • 1-43
      Section 9.2: Hexadecimal, Octal and Binary literals
    • 1-44
      Section 9.3: Boolean literals
    • 1-45
      Section 9.4: String literals
    • 1-46
      Section 9.5: The Null literal
    • 1-47
      Section 9.6: Escape sequences in literals
    • 1-48
      Section 9.7: Character literals
    • 1-49
      Section 9.8: Decimal Integer literals
    • 1-50
      Section 9.9: Floating-point literals
    • 1-51
      Chapter 10: Primitive Data Types
    • 1-52
      Section 10.1: The char primitive
    • 1-53
      Section 10.2: Primitive Types Cheatsheet
    • 1-54
      Section 10.3: The float primitive
    • 1-55
      Section 10.4: The int primitive
    • 1-56
      Section 10.5: Converting Primitives
    • 1-57
      Section 10.6: Memory consumption of primitives vs. boxed primitives
    • 1-58
      Section 10.7: The double primitive
    • 1-59
      Section 10.8: The long primitive
    • 1-60
      Section 10.9: The boolean primitive
    • 1-61
      Section 10.10: The byte primitive
    • 1-62
      Section 10.11: Negative value representation
    • 1-63
      Section 10.12: The short primitive
    • 1-64
      Chapter 11: Strings
    • 1-65
      Section 11.1: Comparing Strings
    • 1-66
      Section 11.2: Changing the case of characters within a String
    • 1-67
      Section 11.3: Finding a String Within Another String
    • 1-68
      Section 11.4: String pool and heap storage
    • 1-69
      Section 11.5: Splitting Strings
    • 1-70
      Section 11.6: Joining Strings with a delimiter
    • 1-71
      Section 11.7: String concatenation and StringBuilders
    • 1-72
      Section 11.8: Substrings
    • 1-73
      Section 11.9: Platform independent new line separator
    • 1-74
      Section 11.10: Reversing Strings
    • 1-75
      Section 11.11: Adding toString() method for custom objects
    • 1-76
      Section 11.12: Remove Whitespace from the Beginning and End of a String
    • 1-77
      Section 11.13: Case insensitive switch
    • 1-78
      Section 11.14: Replacing parts of Strings
    • 1-79
      Section 11.15: Getting the length of a String
    • 1-80
      Section 11.16: Getting the nth character in a String
    • 1-81
      Section 11.17: Counting occurrences of a substring or character in a string
    • 1-82
      Chapter 12: StringBuer
    • 1-83
      Section 12.1: String Buer class
    • 1-84
      Chapter 13: StringBuilder
    • 1-85
      Section 13.1: Comparing StringBuer, StringBuilder, Formatter and StringJoiner
    • 1-86
      Section 13.2: Repeat a String n times
    • 1-87
      Chapter 14: String Tokenizer
    • 1-88
      Section 14.1: StringTokenizer Split by space
    • 1-89
      Section 14.2: StringTokenizer Split by comma ','
    • 1-90
      Chapter 15: Splitting a string into fixed length parts
    • 1-91
      Section 15.1: Break a string up into substrings all of a known length
    • 1-92
      Section 15.2: Break a string up into substrings all of variable length
    • 1-93
      Chapter 16: Date Class
    • 1-94
      Section 16.1: Convert java.util.Date to java.sql.Date
    • 1-95
      Section 16.2: A basic date output
    • 1-96
      Section 16.3: Java 8 LocalDate and LocalDateTime objects
    • 1-97
      Section 16.4: Creating a Specific Date
    • 1-98
      Section 16.5: Converting Date to a certain String format
    • 1-99
      Section 16.6: LocalTime
    • 1-100
      Section 16.7: Convert formatted string representation of date to Date object
    • 1-101
      Section 16.8: Creating Date objects
    • 1-102
      Section 16.9: Comparing Date objects
    • 1-103
      Section 16.10: Converting String into Date
    • 1-104
      Section 16.11: Time Zones and java.util.Date
    • 1-105
      Chapter 17: Dates and Time (java.time.*)
    • 1-106
      Section 17.1: Calculate Dierence between 2 LocalDates
    • 1-107
      Section 17.2: Date and time
    • 1-108
      Section 17.3: Operations on dates and times
    • 1-109
      Section 17.4: Instant
    • 1-110
      Section 17.5: Usage of various classes of Date Time API
    • 1-111
      Section 17.6: Date Time Formatting
    • 1-112
      Section 17.7: Simple Date Manipulations
    • 1-113
      Chapter 18: LocalTime
    • 1-114
      Section 18.1: Amount of time between two LocalTime
    • 1-115
      Section 18.2: Intro
    • 1-116
      Section 18.3: Time Modification
    • 1-117
      Section 18.4: Time Zones and their time dierence
    • 1-118
      Chapter 19: BigDecimal
    • 1-119
      Section 19.1: Comparing BigDecimals
    • 1-120
      Section 19.2: Using BigDecimal instead of float
    • 1-121
      Section 19.3: BigDecimal.valueOf()
    • 1-122
      Section 19.4: Mathematical operations with BigDecimal
    • 1-123
      Section 19.5: Initialization of BigDecimals with value zero, one or ten
    • 1-124
      Section 19.6: BigDecimal objects are immutable
    • 1-125
      Chapter 20: BigInteger
    • 1-126
      Section 20.1: Initialization
    • 1-127
      Section 20.2: BigInteger Mathematical Operations Examples
    • 1-128
      Section 20.3: Comparing BigIntegers
    • 1-129
      Section 20.4: Binary Logic Operations on BigInteger
    • 1-130
      Section 20.5: Generating random BigIntegers
    • 1-131
      Chapter 21: NumberFormat
    • 1-132
      Section 21.1: NumberFormat
    • 1-133
      Chapter 22: Bit Manipulation
    • 1-134
      Section 22.1: Checking, setting, clearing, and toggling individual bits. Using long as bit mask
    • 1-135
      Section 22.2: java.util.BitSet class
    • 1-136
      Section 22.3: Checking if a number is a power of 2
    • 1-137
      Section 22.4: Signed vs unsigned shift
    • 1-138
      Section 22.5: Expressing the power of 2
    • 1-139
      Section 22.6: Packing / unpacking values as bit fragments
    • 1-140
      Chapter 23: Arrays
    • 1-141
      Section 23.1: Creating and Initializing Arrays
    • 1-142
      Section 23.2: Creating a List from an Array
    • 1-143
      Section 23.3: Creating an Array from a Collection
    • 1-144
      Section 23.4: Multidimensional and Jagged Arrays
    • 1-145
      Section 23.5: ArrayIndexOutOfBoundsException
    • 1-146
      Section 23.6: Array Covariance
    • 1-147
      Section 23.7: Arrays to Stream
    • 1-148
      Section 23.8: Iterating over arrays
    • 1-149
      Section 23.9: Arrays to a String
    • 1-150
      Section 23.10: Sorting arrays
    • 1-151
      Section 23.11: Getting the Length of an Array
    • 1-152
      Section 23.12: Finding an element in an array
    • 1-153
      Section 23.13: How do you change the size of an array?
    • 1-154
      Section 23.14: Converting arrays between primitives and boxed types
    • 1-155
      Section 23.15: Remove an element from an array
    • 1-156
      Section 23.16: Comparing arrays for equality
    • 1-157
      Section 23.17: Copying arrays
    • 1-158
      Section 23.18: Casting Arrays
    • 1-159
      Chapter 24: Collections
    • 1-160
      Section 24.1: Removing items from a List within a loop
    • 1-161
      Section 24.2: Constructing collections from existing data
    • 1-162
      Section 24.3: Declaring an ArrayList and adding objects
    • 1-163
      Section 24.4: Iterating over Collections
    • 1-164
      Section 24.5: Immutable Empty Collections
    • 1-165
      Section 24.6: Sub Collections
    • 1-166
      Section 24.7: Unmodifiable Collection
    • 1-167
      Section 24.8: Pitfall: concurrent modification exceptions
    • 1-168
      Section 24.9: Removing matching items from Lists using Iterator
    • 1-169
      Section 24.10: Join lists
    • 1-170
      Section 24.11: Creating your own Iterable structure for use with Iterator or for-each loop
    • 1-171
      Section 24.12: Collections and Primitive Values
    • 1-172
      Chapter 25: Lists
    • 1-173
      Section 25.1: Sorting a generic list
    • 1-174
      Section 25.2: Convert a list of integers to a list of strings
    • 1-175
      Section 25.3: Classes implementing List - Pros and Cons
    • 1-176
      Section 25.4: Finding common elements between 2 lists
    • 1-177
      Section 25.5: In-place replacement of a List element
    • 1-178
      Section 25.6: Making a list unmodifiable
    • 1-179
      Section 25.7: Moving objects around in the list
    • 1-180
      Section 25.8: Creating, Adding and Removing element from an ArrayList
    • 1-181
      Section 25.9: Creating a List
    • 1-182
      Section 25.10: Positional Access Operations
    • 1-183
      Section 25.11: Iterating over elements in a list
    • 1-184
      Section 25.12: Removing elements from list B that are present in the list A
    • 1-185
      Chapter 26: Sets
    • 1-186
      Section 26.1: Initialization
    • 1-187
      Section 26.2: Basics of Set
    • 1-188
      Section 26.3: Types and Usage of Sets
    • 1-189
      Section 26.4: Create a list from an existing Set
    • 1-190
      Section 26.5: Eliminating duplicates using Set
    • 1-191
      Section 26.6: Declaring a HashSet with values
    • 1-192
      Chapter 27: List vs Set
    • 1-193
      Section 27.1: List vs Set
    • 1-194
      Chapter 28: Maps
    • 1-195
      Section 28.1: Iterating Map Entries Eciently
    • 1-196
      Section 28.2: Usage of HashMap
    • 1-197
      Section 28.3: Using Default Methods of Map from Java 8
    • 1-198
      Section 28.4: Iterating through the contents of a Map
    • 1-199
      Section 28.5: Merging, combine and composing Maps
    • 1-200
      Section 28.6: Add multiple items
    • 1-201
      Section 28.7: Creating and Initializing Maps
    • 1-202
      Section 28.8: Check if key exists
    • 1-203
      Section 28.9: Add an element
    • 1-204
      Section 28.10: Clear the map
    • 1-205
      Section 28.11: Use custom object as key
    • 1-206
      Chapter 29: LinkedHashMap
    • 1-207
      Section 29.1: Java LinkedHashMap class
    • 1-208
      Chapter 30: WeakHashMap
    • 1-209
      Section 30.1: Concepts of WeakHashmap
    • 1-210
      Chapter 31: SortedMap
    • 1-211
      Section 31.1: Introduction to sorted Map
    • 1-212
      Chapter 32: TreeMap and TreeSet
    • 1-213
      Section 32.1: TreeMap of a simple Java type
    • 1-214
      Section 32.2: TreeSet of a simple Java Type
    • 1-215
      Section 32.3: TreeMap/TreeSet of a custom Java type
    • 1-216
      Section 32.4: TreeMap and TreeSet Thread Safety
    • 1-217
      Chapter 33: Queues and Deques
    • 1-218
      Section 33.1: The usage of the PriorityQueue
    • 1-219
      Section 33.2: Deque
    • 1-220
      Section 33.3: Stacks
    • 1-221
      Section 33.4: BlockingQueue
    • 1-222
      Section 33.5: LinkedList as a FIFO Queue
    • 1-223
      Section 33.6: Queue Interface
    • 1-224
      Chapter 34: Dequeue Interface
    • 1-225
      Section 34.1: Adding Elements to Deque
    • 1-226
      Section 34.2: Removing Elements from Deque
    • 1-227
      Section 34.3: Retrieving Element without Removing
    • 1-228
      Section 34.4: Iterating through Deque
    • 1-229
      Chapter 35: Enums
    • 1-230
      Section 35.1: Declaring and using a basic enum
    • 1-231
      Section 35.2: Enums with constructors
    • 1-232
      Section 35.3: Enums with Abstract Methods
    • 1-233
      Section 35.4: Implements Interface
    • 1-234
      Section 35.5: Implement Singleton pattern with a single-element enum
    • 1-235
      Section 35.6: Using methods and static blocks
    • 1-236
      Section 35.7: Zero instance enum
    • 1-237
      Section 35.8: Enum as a bounded type parameter
    • 1-238
      Section 35.9: Documenting enums
    • 1-239
      Section 35.10: Enum constant specific body
    • 1-240
      Section 35.11: Getting the values of an enum
    • 1-241
      Section 35.12: Enum Polymorphism Pattern
    • 1-242
      Section 35.13: Compare and Contains for Enum values
    • 1-243
      Section 35.14: Get enum constant by name
    • 1-244
      Section 35.15: Enum with properties (fields)
    • 1-245
      Section 35.16: Convert enum to String
    • 1-246
      Section 35.17: Enums with static fields
    • 1-247
      Chapter 36: Enum Map
    • 1-248
      Section 36.1: Enum Map Book Example
    • 1-249
      Chapter 37: EnumSet class
    • 1-250
      Section 37.1: Enum Set Example
    • 1-251
      Chapter 38: Enum starting with number
    • 1-252
      Section 38.1: Enum with name at beginning
    • 1-253
      Chapter 39: Hashtable
    • 1-254
      Section 39.1: Hashtable
    • 1-255
      Chapter 40: Operators
    • 1-256
      Section 40.1: The Increment/Decrement Operators (++/--)
    • 1-257
      Section 40.2: The Conditional Operator (? :)
    • 1-258
      Section 40.3: The Bitwise and Logical Operators (~, &, |, ^)
    • 1-259
      Section 40.4: The String Concatenation Operator (+)
    • 1-260
      Section 40.5: The Arithmetic Operators (+, -, *, /, %)
    • 1-261
      Section 40.6: The Shift Operators (<<, >> and >>>)
    • 1-262
      Section 40.7: The Instanceof Operator
    • 1-263
      Section 40.8: The Assignment Operators (=, +=, -=, *=, /=, %=, <<=, >>= , >>>=, &=, |= and ^=)
    • 1-264
      Section 40.9: The conditional-and and conditional-or Operators ( && and || )
    • 1-265
      Section 40.10: The Relational Operators (<, <=, >, >=)
    • 1-266
      Section 40.11: The Equality Operators (==, !=)
    • 1-267
      Section 40.12: The Lambda operator ( -> )
    • 1-268
      Chapter 41: Constructors
    • 1-269
      Section 41.1: Default Constructor
    • 1-270
      Section 41.2: Call parent constructor
    • 1-271
      Section 41.3: Constructor with Arguments
    • 1-272
      Chapter 42: Object Class Methods and Constructor
    • 1-273
      Section 42.1: hashCode() method
    • 1-274
      Section 42.2: toString() method
    • 1-275
      Section 42.3: equals() method
    • 1-276
      Section 42.4: wait() and notify() methods
    • 1-277
      Section 42.5: getClass() method
    • 1-278
      Section 42.6: clone() method
    • 1-279
      Section 42.7: Object constructor
    • 1-280
      Section 42.8: finalize() method
    • 1-281
      Chapter 43: Annotations
    • 1-282
      Section 43.1: The idea behind Annotations
    • 1-283
      Section 43.2: Defining annotation types
    • 1-284
      Section 43.3: Runtime annotation checks via reflection
    • 1-285
      Section 43.4: Built-in annotations
    • 1-286
      Section 43.5: Compile time processing using annotation processor
    • 1-287
      Section 43.6: Repeating Annotations
    • 1-288
      Section 43.7: Inherited Annotations
    • 1-289
      Section 43.8: Getting Annotation values at run-time
    • 1-290
      Section 43.9: Annotations for 'this' and receiver parameters
    • 1-291
      Section 43.10: Add multiple annotation values
    • 1-292
      Chapter 44: Immutable Class
    • 1-293
      Section 44.1: Example without mutable refs
    • 1-294
      Section 44.2: What is the advantage of immutability?
    • 1-295
      Section 44.3: Rules to define immutable classes
    • 1-296
      Section 44.4: Example with mutable refs
    • 1-297
      Chapter 45: Immutable Objects
    • 1-298
      Section 45.1: Creating an immutable version of a type using defensive copying
    • 1-299
      Section 45.2: The recipe for an immutable class
    • 1-300
      Section 45.3: Typical design flaws which prevent a class from being immutable
    • 1-301
      Chapter 46: Visibility (controlling access to members of a class)
    • 1-302
      Section 46.1: Private Visibility
    • 1-303
      Section 46.2: Public Visibility
    • 1-304
      Section 46.3: Package Visibility
    • 1-305
      Section 46.4: Protected Visibility
    • 1-306
      Section 46.5: Summary of Class Member Access Modifiers
    • 1-307
      Section 46.6: Interface members
    • 1-308
      Chapter 47: Generics
    • 1-309
      Section 47.1: Creating a Generic Class
    • 1-310
      Section 47.2: Deciding between `T`, `? super T`, and `? extends T`
    • 1-311
      Section 47.3: The Diamond
    • 1-312
      Section 47.4: Declaring a Generic Method
    • 1-313
      Section 47.5: Requiring multiple upper bounds ("extends A & B")
    • 1-314
      Section 47.6: Obtain class that satisfies generic parameter at runtime
    • 1-315
      Section 47.7: Benefits of Generic class and interface
    • 1-316
      Section 47.8: Instantiating a generic type
    • 1-317
      Section 47.9: Creating a Bounded Generic Class
    • 1-318
      Section 47.10: Referring to the declared generic type within its own declaration
    • 1-319
      Section 47.11: Binding generic parameter to more than 1 type
    • 1-320
      Section 47.12: Using Generics to auto-cast
    • 1-321
      Section 47.13: Use of instanceof with Generics
    • 1-322
      Section 47.14: Dierent ways for implementing a Generic Interface (or extending a Generic Class)
    • 1-323
      Chapter 48: Classes and Objects
    • 1-324
      Section 48.1: Overloading Methods
    • 1-325
      Section 48.2: Explaining what is method overloading and overriding
    • 1-326
      Section 48.3: Constructors
    • 1-327
      Section 48.4: Initializing static final fields using a static initializer
    • 1-328
      Section 48.5: Basic Object Construction and Use
    • 1-329
      Section 48.6: Simplest Possible Class
    • 1-330
      Section 48.7: Object Member vs Static Member
    • 1-331
      Chapter 49: Local Inner Class
    • 1-332
      Section 49.1: Local Inner Class
    • 1-333
      Chapter 50: Nested and Inner Classes
    • 1-334
      Section 50.1: A Simple Stack Using a Nested Class
    • 1-335
      Section 50.2: Static vs Non Static Nested Classes
    • 1-336
      Section 50.3: Access Modifiers for Inner Classes
    • 1-337
      Section 50.4: Anonymous Inner Classes
    • 1-338
      Section 50.5: Create instance of non-static inner class from outside
    • 1-339
      Section 50.6: Method Local Inner Classes
    • 1-340
      Section 50.7: Accessing the outer class from a non-static inner class
    • 1-341
      Chapter 51: The java.util.Objects Class
    • 1-342
      Section 51.1: Basic use for object null check
    • 1-343
      Section 51.2: Objects.nonNull() method reference use in stream api
    • 1-344
      Chapter 52: Default Methods
    • 1-345
      Section 52.1: Basic usage of default methods
    • 1-346
      Section 52.2: Accessing overridden default methods from implementing class
    • 1-347
      Section 52.3: Why use Default Methods?
    • 1-348
      Section 52.4: Accessing other interface methods within default method
    • 1-349
      Section 52.5: Default method multiple inheritance collision
    • 1-350
      Section 52.6: Class, Abstract class and Interface method precedence
    • 1-351
      Chapter 53: Packages
    • 1-352
      Section 53.1: Using Packages to create classes with the same name
    • 1-353
      Section 53.2: Using Package Protected Scope
    • 1-354
      Chapter 54: Inheritance
    • 1-355
      Section 54.1: Inheritance
    • 1-356
      Section 54.2: Abstract Classes
    • 1-357
      Section 54.3: Using 'final' to restrict inheritance and overriding
    • 1-358
      Section 54.4: The Liskov Substitution Principle
    • 1-359
      Section 54.5: Abstract class and Interface usage: "Is-a" relation vs "Has-a" capability
    • 1-360
      Section 54.6: Static Inheritance
    • 1-361
      Section 54.7: Programming to an interface
    • 1-362
      Section 54.8: Overriding in Inheritance
    • 1-363
      Section 54.9: Variable shadowing
    • 1-364
      Section 54.10: Narrowing and Widening of object references
    • 1-365
      Section 54.11: Inheritance and Static Methods
    • 1-366
      Chapter 55: Reference Types
    • 1-367
      Section 55.1: Dierent Reference Types
    • 1-368
      Chapter 56: Console I/O
    • 1-369
      Section 56.1: Reading user input from the console
    • 1-370
      Section 56.2: Aligning strings in console
    • 1-371
      Section 56.3: Implementing Basic Command-Line Behavior
    • 1-372
      Chapter 57: Streams
    • 1-373
      Section 57.1: Using Streams
    • 1-374
      Section 57.2: Consuming Streams
    • 1-375
      Section 57.3: Creating a Frequency Map
    • 1-376
      Section 57.4: Infinite Streams
    • 1-377
      Section 57.5: Collect Elements of a Stream into a Collection
    • 1-378
      Section 57.6: Using Streams to Implement Mathematical Functions
    • 1-379
      Section 57.7: Flatten Streams with flatMap()
    • 1-380
      Section 57.8: Parallel Stream
    • 1-381
      Section 57.9: Creating a Stream
    • 1-382
      Section 57.10: Finding Statistics about Numerical Streams
    • 1-383
      Section 57.11: Converting an iterator to a stream
    • 1-384
      Section 57.12: Using IntStream to iterate over indexes
    • 1-385
      Section 57.13: Concatenate Streams
    • 1-386
      Section 57.14: Reduction with Streams
    • 1-387
      Section 57.15: Using Streams of Map.Entry to Preserve Initial Values after Mapping
    • 1-388
      Section 57.16: IntStream to String
    • 1-389
      Section 57.17: Finding the First Element that Matches a Predicate
    • 1-390
      Section 57.18: Using Streams and Method References to Write Self-Documenting Processes
    • 1-391
      Section 57.19: Converting a Stream of Optional to a Stream of Values
    • 1-392
      Section 57.20: Get a Slice of a Stream
    • 1-393
      Section 57.21: Create a Map based on a Stream
    • 1-394
      Section 57.22: Joining a stream to a single String
    • 1-395
      Section 57.23: Sort Using Stream
    • 1-396
      Section 57.24: Streams of Primitives
    • 1-397
      Section 57.25: Stream operations categories
    • 1-398
      Section 57.26: Collect Results of a Stream into an Array
    • 1-399
      Section 57.27: Generating random Strings using Streams
    • 1-400
      Chapter 58: InputStreams and OutputStreams
    • 1-401
      Section 58.1: Closing Streams
    • 1-402
      Section 58.2: Reading InputStream into a String
    • 1-403
      Section 58.3: Wrapping Input/Output Streams
    • 1-404
      Section 58.4: DataInputStream Example
    • 1-405
      Section 58.5: Writing bytes to an OutputStream
    • 1-406
      Section 58.6: Copying Input Stream to Output Stream
    • 1-407
      Chapter 59: Readers and Writers
    • 1-408
      Section 59.1: BueredReader
    • 1-409
      Section 59.2: StringWriter Example
    • 1-410
      Chapter 60: Preferences
    • 1-411
      Section 60.1: Using preferences
    • 1-412
      Section 60.2: Adding event listeners
    • 1-413
      Section 60.3: Getting sub-nodes of Preferences
    • 1-414
      Section 60.4: Coordinating preferences access across multiple application instances
    • 1-415
      Section 60.5: Exporting preferences
    • 1-416
      Section 60.6: Importing preferences
    • 1-417
      Section 60.7: Removing event listeners
    • 1-418
      Section 60.8: Getting preferences values
    • 1-419
      Section 60.9: Setting preferences values
    • 1-420
      Chapter 61: Collection Factory Methods
    • 1-421
      Section 61.1: List<E> Factory Method Examples
    • 1-422
      Section 61.2: Set<E> Factory Method Examples
    • 1-423
      Section 61.3: Map<K, V> Factory Method Examples
    • 1-424
      Chapter 62: Alternative Collections
    • 1-425
      Section 62.1: Multimap in Guava, Apache and Eclipse Collections
    • 1-426
      Section 62.2: Apache HashBag, Guava HashMultiset and Eclipse HashBag
    • 1-427
      Section 62.3: Compare operation with collections - Create collections
    • 1-428
      Chapter 63: Concurrent Collections
    • 1-429
      Section 63.1: Thread-safe Collections
    • 1-430
      Section 63.2: Insertion into ConcurrentHashMap
    • 1-431
      Section 63.3: Concurrent Collections
    • 1-432
      Chapter 64: Choosing Collections
    • 1-433
      Section 64.1: Java Collections Flowchart
    • 1-434
      Chapter 65: super keyword
    • 1-435
      Section 65.1: Super keyword use with examples
    • 1-436
      Chapter 66: Serialization
    • 1-437
      Section 66.1: Basic Serialization in Java
    • 1-438
      Section 66.2: Custom Serialization
    • 1-439
      Section 66.3: Versioning and serialVersionUID
    • 1-440
      Section 66.4: Serialization with Gson
    • 1-441
      Section 66.5: Custom JSON Deserialization with Jackson
    • 1-442
      Chapter 67: Optional
    • 1-443
      Section 67.1: Map
    • 1-444
      Section 67.2: Return default value if Optional is empty
    • 1-445
      Section 67.3: Throw an exception, if there is no value
    • 1-446
      Section 67.4: Lazily provide a default value using a Supplier
    • 1-447
      Section 67.5: Filter
    • 1-448
      Section 67.6: Using Optional containers for primitive number types
    • 1-449
      Section 67.7: Run code only if there is a value present
    • 1-450
      Section 67.8: FlatMap
    • 1-451
      Chapter 68: Object References
    • 1-452
      Section 68.1: Object References as method parameters
    • 1-453
      Chapter 69: Exceptions and exception handling
    • 1-454
      Section 69.1: Catching an exception with try-catch
    • 1-455
      Section 69.2: The try-with-resources statement
    • 1-456
      Section 69.3: Custom Exceptions
    • 1-457
      Section 69.4: Handling InterruptedException
    • 1-458
      Section 69.5: Return statements in try catch block
    • 1-459
      Section 69.6: Introduction
    • 1-460
      Section 69.7: The Java Exception Hierarchy - Unchecked and Checked Exceptions
    • 1-461
      Section 69.8: Creating and reading stacktraces
    • 1-462
      Section 69.9: Throwing an exception
    • 1-463
      Section 69.10: Advanced features of Exceptions
    • 1-464
      Section 69.11: The try-finally and try-catch-finally statements
    • 1-465
      Section 69.12: The 'throws' clause in a method declaration
    • 1-466
      Chapter 70: Calendar and its Subclasses
    • 1-467
      Section 70.1: Creating Calendar objects
    • 1-468
      Section 70.2: Increasing / Decreasing calendar fields
    • 1-469
      Section 70.3: Subtracting calendars
    • 1-470
      Section 70.4: Finding AM/PM
    • 1-471
      Chapter 71: Using the static keyword
    • 1-472
      Section 71.1: Reference to non-static member from static context
    • 1-473
      Section 71.2: Using static to declare constants
    • 1-474
      Chapter 72: Properties Class
    • 1-475
      Section 72.1: Loading properties
    • 1-476
      Section 72.2: Saving Properties as XML
    • 1-477
      Section 72.3: Property files caveat: trailing whitespace
    • 1-478
      Chapter 73: Lambda Expressions
    • 1-479
      Section 73.1: Introduction to Java lambdas
    • 1-480
      Section 73.2: Using Lambda Expressions to Sort a Collection
    • 1-481
      Section 73.3: Method References
    • 1-482
      Section 73.4: Implementing multiple interfaces
    • 1-483
      Section 73.5: Lambda - Listener Example
    • 1-484
      Section 73.6: Java Closures with lambda expressions
    • 1-485
      Section 73.7: Lambdas and memory utilization
    • 1-486
      Section 73.8: Using lambda expression with your own functional interface
    • 1-487
      Section 73.9: Traditional style to Lambda style
    • 1-488
      Section 73.10: `return` only returns from the lambda, not the outer method
    • 1-489
      Section 73.11: Lambdas and Execute-around Pattern
    • 1-490
      Section 73.12: Using lambda expressions & predicates to get a certain value(s) from a list
    • 1-491
      Chapter 74: Basic Control Structures
    • 1-492
      Section 74.1: Switch statement
    • 1-493
      Section 74.2: do...while Loop
    • 1-494
      Section 74.3: For Each
    • 1-495
      Section 74.4: Continue Statement in Java
    • 1-496
      Section 74.5: If / Else If / Else Control
    • 1-497
      Section 74.6: For Loops
    • 1-498
      Section 74.7: Ternary Operator
    • 1-499
      Section 74.8: Try ... Catch ... Finally
    • 1-500
      Section 74.9: Break
    • 1-501
      Section 74.10: While Loops
    • 1-502
      Section 74.11: If / Else
    • 1-503
      Section 74.12: Nested break / continue
    • 1-504
      Chapter 75: BueredWriter
    • 1-505
      Section 75.1: Write a line of text to File
    • 1-506
      Chapter 76: New File I/O
    • 1-507
      Section 76.1: Creating paths
    • 1-508
      Section 76.2: Manipulating paths
    • 1-509
      Section 76.3: Retrieving information about a path
    • 1-510
      Section 76.4: Retrieving information using the filesystem
    • 1-511
      Section 76.5: Reading files
    • 1-512
      Section 76.6: Writing files
    • 1-513
      Chapter 77: File I/O
    • 1-514
      Section 77.1: Migrating from java.io.File to Java 7 NIO (java.nio.file.Path)
    • 1-515
      Section 77.2: Reading an image from a file
    • 1-516
      Section 77.3: File Read/Write Using FileInputStream/FileOutputStream
    • 1-517
      Section 77.4: Reading all bytes to a byte[]
    • 1-518
      Section 77.5: Copying a file using Channel
    • 1-519
      Section 77.6: Writing a byte[] to a file
    • 1-520
      Section 77.7: Stream vs Writer/Reader API
    • 1-521
      Section 77.8: Reading a file with a Scanner
    • 1-522
      Section 77.9: Copying a file using InputStream and OutputStream
    • 1-523
      Section 77.10: Reading from a binary file
    • 1-524
      Section 77.11: Reading a file using Channel and Buer
    • 1-525
      Section 77.12: Adding Directories
    • 1-526
      Section 77.13: Blocking or redirecting standard output / error
    • 1-527
      Section 77.14: Reading a whole file at once
    • 1-528
      Section 77.15: Locking
    • 1-529
      Section 77.16: Reading a file using BueredInputStream
    • 1-530
      Section 77.17: Iterate over a directory printing subdirectories in it
    • 1-531
      Section 77.18: Writing a file using Channel and Buer
    • 1-532
      Section 77.19: Writing a file using PrintStream
    • 1-533
      Section 77.20: Iterating over a directory and filter by file extension
    • 1-534
      Section 77.21: Accessing the contents of a ZIP file
    • 1-535
      Chapter 78: Scanner
    • 1-536
      Section 78.1: General Pattern that does most commonly asked about tasks
    • 1-537
      Section 78.2: Using custom delimiters
    • 1-538
      Section 78.3: Reading system input using Scanner
    • 1-539
      Section 78.4: Reading file input using Scanner
    • 1-540
      Section 78.5: Read the entire input as a String using Scanner
    • 1-541
      Section 78.6: Carefully Closing a Scanner
    • 1-542
      Section 78.7: Read an int from the command line
    • 1-543
      Chapter 79: Interfaces
    • 1-544
      Section 79.1: Implementing multiple interfaces
    • 1-545
      Section 79.2: Declaring and Implementing an Interface
    • 1-546
      Section 79.3: Extending an interface
    • 1-547
      Section 79.4: Usefulness of interfaces
    • 1-548
      Section 79.5: Default methods
    • 1-549
      Section 79.6: Modifiers in Interfaces
    • 1-550
      Section 79.7: Using Interfaces with Generics
    • 1-551
      Section 79.8: Strengthen bounded type parameters
    • 1-552
      Section 79.9: Implementing interfaces in an abstract class
    • 1-553
      Chapter 80: Regular Expressions
    • 1-554
      Section 80.1: Using capture groups
    • 1-555
      Section 80.2: Using regex with custom behaviour by compiling the Pattern with flags
    • 1-556
      Section 80.3: Escape Characters
    • 1-557
      Section 80.4: Not matching a given string
    • 1-558
      Section 80.5: Matching with a regex literal
    • 1-559
      Section 80.6: Matching a backslash
    • 1-560
      Chapter 81: Comparable and Comparator
    • 1-561
      Section 81.1: Sorting a List using Comparable<T> or a Comparator<T>
    • 1-562
      Section 81.2: The compareTo and compare Methods
    • 1-563
      Section 81.3: Natural (comparable) vs explicit (comparator) sorting
    • 1-564
      Section 81.4: Creating a Comparator using comparing method
    • 1-565
      Section 81.5: Sorting Map entries
    • 1-566
      Chapter 82: Java Floating Point Operations
    • 1-567
      Section 82.1: Comparing floating point values
    • 1-568
      Section 82.2: OverFlow and UnderFlow
    • 1-569
      Section 82.3: Formatting the floating point values
    • 1-570
      Section 82.4: Strict Adherence to the IEEE Specification
    • 1-571
      Chapter 83: Currency and Money
    • 1-572
      Section 83.1: Add custom currency
    • 1-573
      Chapter 84: Object Cloning
    • 1-574
      Section 84.1: Cloning performing a deep copy
    • 1-575
      Section 84.2: Cloning using a copy factory
    • 1-576
      Section 84.3: Cloning using a copy constructor
    • 1-577
      Section 84.4: Cloning by implementing Clonable interface
    • 1-578
      Section 84.5: Cloning performing a shallow copy
    • 1-579
      Chapter 85: Recursion
    • 1-580
      Section 85.1: The basic idea of recursion
    • 1-581
      Section 85.2: Deep recursion is problematic in Java
    • 1-582
      Section 85.3: Types of Recursion
    • 1-583
      Section 85.4: Computing the Nth Fibonacci Number
    • 1-584
      Section 85.5: StackOverflowError & recursion to loop
    • 1-585
      Section 85.6: Computing the Nth power of a number
    • 1-586
      Section 85.7: Traversing a Tree data structure with recursion
    • 1-587
      Section 85.8: Reverse a string using Recursion
    • 1-588
      Section 85.9: Computing the sum of integers from 1 to N
    • 1-589
      Chapter 86: Converting to and from Strings
    • 1-590
      Section 86.1: Converting String to other datatypes
    • 1-591
      Section 86.2: Conversion to / from bytes
    • 1-592
      Section 86.3: Base64 Encoding / Decoding
    • 1-593
      Section 86.4: Converting other datatypes to String
    • 1-594
      Section 86.5: Getting a `String` from an `InputStream`
    • 1-595
      Chapter 87: Random Number Generation
    • 1-596
      Section 87.1: Pseudo Random Numbers
    • 1-597
      Section 87.2: Pseudo Random Numbers in Specific Range
    • 1-598
      Section 87.3: Generating cryptographically secure pseudorandom numbers
    • 1-599
      Section 87.4: Generating Random Numbers with a Specified Seed
    • 1-600
      Section 87.5: Select random numbers without duplicates
    • 1-601
      Section 87.6: Generating Random number using apache-common lang3
    • 1-602
      Chapter 88: Singletons
    • 1-603
      Section 88.1: Enum Singleton
    • 1-604
      Section 88.2: Singleton without use of Enum (eager initialization)
    • 1-605
      Section 88.3: Thread-safe lazy initialization using holder class | Bill Pugh Singleton implementation
    • 1-606
      Section 88.4: Thread safe Singleton with double checked locking
    • 1-607
      Section 88.5: Extending singleton (singleton inheritance)
    • 1-608
      Chapter 89: Autoboxing
    • 1-609
      Section 89.1: Using int and Integer interchangeably
    • 1-610
      Section 89.2: Auto-unboxing may lead to NullPointerException
    • 1-611
      Section 89.3: Using Boolean in if statement
    • 1-612
      Section 89.4: Dierent Cases When Integer and int can be used interchangeably
    • 1-613
      Section 89.5: Memory and Computational Overhead of Autoboxing
    • 1-614
      Chapter 90: 2D Graphics in Java
    • 1-615
      Section 90.1: Example 1: Draw and Fill a Rectangle Using Java
    • 1-616
      Section 90.2: Example 2: Drawing and Filling Oval
    • 1-617
      Chapter 91: JAXB
    • 1-618
      Section 91.1: Reading an XML file (unmarshalling)
    • 1-619
      Section 91.2: Writing an XML file (marshalling an object)
    • 1-620
      Section 91.3: Manual field/property XML mapping configuration
    • 1-621
      Section 91.4: Binding an XML namespace to a serializable Java class
    • 1-622
      Section 91.5: Using XmlAdapter to generate desired xml format
    • 1-623
      Section 91.6: Using XmlAdapter to trim string
    • 1-624
      Section 91.7: Automatic field/property XML mapping configuration (@XmlAccessorType)
    • 1-625
      Section 91.8: Specifying a XmlAdapter instance to (re)use existing data
    • 1-626
      Chapter 92: Class - Java Reflection
    • 1-627
      Section 92.1: getClass() method of Object class
    • 1-628
      Chapter 93: Networking
    • 1-629
      Section 93.1: Basic Client and Server Communication using a Socket
    • 1-630
      Section 93.2: Basic Client/Server Communication using UDP (Datagram)
    • 1-631
      Section 93.3: Loading TrustStore and KeyStore from InputStream
    • 1-632
      Section 93.4: Socket example - reading a web page using a simple socket
    • 1-633
      Section 93.5: Temporarily disable SSL verification (for testing purposes)
    • 1-634
      Section 93.6: Downloading a file using Channel
    • 1-635
      Section 93.7: Multicasting
    • 1-636
      Chapter 94: NIO - Networking
    • 1-637
      Section 94.1: Using Selector to wait for events (example with OP_CONNECT)
    • 1-638
      Chapter 95: HttpURLConnection
    • 1-639
      Section 95.1: Get response body from a URL as a String
    • 1-640
      Section 95.2: POST data
    • 1-641
      Section 95.3: Delete resource
    • 1-642
      Section 95.4: Check if resource exists
    • 1-643
      Chapter 96: JAX-WS
    • 1-644
      Section 96.1: Basic Authentication
    • 1-645
      Chapter 97: Nashorn JavaScript engine
    • 1-646
      Section 97.1: Execute JavaScript file
    • 1-647
      Section 97.2: Intercept script output
    • 1-648
      Section 97.3: Hello Nashorn
    • 1-649
      Section 97.4: Evaluate Arithmetic Strings
    • 1-650
      Section 97.5: Set global variables
    • 1-651
      Section 97.6: Set and get global variables
    • 1-652
      Section 97.7: Usage of Java objects in JavaScript in Nashorn
    • 1-653
      Section 97.8: Implementing an interface from script
    • 1-654
      Chapter 98: Java Native Interface
    • 1-655
      Section 98.1: Calling C++ methods from Java
    • 1-656
      Section 98.2: Calling Java methods from C++ (callback)
    • 1-657
      Section 98.3: Loading native libraries
    • 1-658
      Chapter 99: Functional Interfaces
    • 1-659
      Section 99.1: List of standard Java Runtime Library functional interfaces by signature
    • 1-660
      Chapter 100: Fluent Interface
    • 1-661
      Section 100.1: Fluent programming style
    • 1-662
      Section 100.2: Truth - Fluent Testing Framework
    • 1-663
      Chapter 101: Remote Method Invocation (RMI)
    • 1-664
      Section 101.1: Callback: invoking methods on a "client"
    • 1-665
      Section 101.2: Simple RMI example with Client and Server implementation
    • 1-666
      Section 101.3: Client-Server: invoking methods in one JVM from another
    • 1-667
      Chapter 102: Iterator and Iterable
    • 1-668
      Section 102.1: Removing elements using an iterator
    • 1-669
      Section 102.2: Creating your own Iterable
    • 1-670
      Section 102.3: Using Iterable in for loop
    • 1-671
      Section 102.4: Using the raw iterator
    • 1-672
      Chapter 103: Reflection API
    • 1-673
      Section 103.1: Dynamic Proxies
    • 1-674
      Section 103.2: Introduction
    • 1-675
      Section 103.3: Evil Java hacks with Reflection
    • 1-676
      Section 103.4: Misuse of Reflection API to change private and final variables
    • 1-677
      Section 103.5: Getting and Setting fields
    • 1-678
      Section 103.6: Call constructor
    • 1-679
      Section 103.7: Call constructor of nested class
    • 1-680
      Section 103.8: Invoking a method
    • 1-681
      Section 103.9: Get Class given its (fully qualified) name
    • 1-682
      Section 103.10: Getting the Constants of an Enumeration
    • 1-683
      Section 103.11: Call overloaded constructors using reflection
    • 1-684
      Chapter 104: ByteBuer
    • 1-685
      Section 104.1: Basic Usage - Using DirectByteBuer
    • 1-686
      Section 104.2: Basic Usage - Creating a ByteBuer
    • 1-687
      Section 104.3: Basic Usage - Write Data to the Buer
    • 1-688
      Chapter 105: Applets
    • 1-689
      Section 105.1: Minimal Applet
    • 1-690
      Section 105.2: Creating a GUI
    • 1-691
      Section 105.3: Open links from within the applet
    • 1-692
      Section 105.4: Loading images, audio and other resources
    • 1-693
      Chapter 106: Expressions
    • 1-694
      Section 106.1: Operator Precedence
    • 1-695
      Section 106.2: Expression Basics
    • 1-696
      Section 106.3: Expression evaluation order
    • 1-697
      Section 106.4: Constant Expressions
    • 1-698
      Chapter 107: JSON in Java
    • 1-699
      Section 107.1: Using Jackson Object Mapper
    • 1-700
      Section 107.2: JSON To Object (Gson Library)
    • 1-701
      Section 107.3: JSONObject.NULL
    • 1-702
      Section 107.4: JSON Builder - chaining methods
    • 1-703
      Section 107.5: Object To JSON (Gson Library)
    • 1-704
      Section 107.6: JSON Iteration
    • 1-705
      Section 107.7: optXXX vs getXXX methods
    • 1-706
      Section 107.8: Extract single element from JSON
    • 1-707
      Section 107.9: JsonArray to Java List (Gson Library)
    • 1-708
      Section 107.10: Encoding data as JSON
    • 1-709
      Section 107.11: Decoding JSON data
    • 1-710
      Chapter 108: XML Parsing using the JAXP APIs
    • 1-711
      Section 108.1: Parsing a document using the StAX API
    • 1-712
      Section 108.2: Parsing and navigating a document using the DOM API
    • 1-713
      Chapter 109: XML XPath Evaluation
    • 1-714
      Section 109.1: Parsing multiple XPath Expressions in a single XML
    • 1-715
      Section 109.2: Parsing single XPath Expression multiple times in an XML
    • 1-716
      Section 109.3: Evaluating a NodeList in an XML document
    • 1-717
      Chapter 110: XOM - XML Object Model
    • 1-718
      Section 110.1: Reading a XML file
    • 1-719
      Section 110.2: Writing to a XML File
    • 1-720
      Chapter 111: Polymorphism
    • 1-721
      Section 111.1: Method Overriding
    • 1-722
      Section 111.2: Method Overloading
    • 1-723
      Section 111.3: Polymorphism and dierent types of overriding
    • 1-724
      Section 111.4: Virtual functions
    • 1-725
      Section 111.5: Adding behaviour by adding classes without touching existing code
    • 1-726
      Chapter 112: Encapsulation
    • 1-727
      Section 112.1: Encapsulation to maintain invariants
    • 1-728
      Section 112.2: Encapsulation to reduce coupling
    • 1-729
      Chapter 113: Java Agents
    • 1-730
      Section 113.1: Modifying classes with agents
    • 1-731
      Section 113.2: Adding an agent at runtime
    • 1-732
      Section 113.3: Setting up a basic agent
    • 1-733
      Chapter 114: Varargs (Variable Argument)
    • 1-734
      Section 114.1: Working with Varargs parameters
    • 1-735
      Section 114.2: Specifying a varargs parameter
    • 1-736
      Chapter 115: Logging (java.util.logging)
    • 1-737
      Section 115.1: Logging complex messages (eciently)
    • 1-738
      Section 115.2: Using the default logger
    • 1-739
      Section 115.3: Logging levels
    • 1-740
      Chapter 116: log4j / log4j2
    • 1-741
      Section 116.1: Properties-File to log to DB
    • 1-742
      Section 116.2: How to get Log4j
    • 1-743
      Section 116.3: Setting up property file
    • 1-744
      Section 116.4: Basic log4j2.xml configuration file
    • 1-745
      Section 116.5: How to use Log4j in Java code
    • 1-746
      Section 116.6: Migrating from log4j 1.x to 2.x
    • 1-747
      Section 116.7: Filter Logoutput by level (log4j 1.x)
    • 1-748
      Chapter 117: Oracle Ocial Code Standard
    • 1-749
      Section 117.1: Naming Conventions
    • 1-750
      Section 117.2: Class Structure
    • 1-751
      Section 117.3: Annotations
    • 1-752
      Section 117.4: Import statements
    • 1-753
      Section 117.5: Braces
    • 1-754
      Section 117.6: Redundant Parentheses
    • 1-755
      Section 117.7: Modifiers
    • 1-756
      Section 117.8: Indentation
    • 1-757
      Section 117.9: Literals
    • 1-758
      Section 117.10: Package declaration
    • 1-759
      Section 117.11: Lambda Expressions
    • 1-760
      Section 117.12: Java Source Files
    • 1-761
      Section 117.13: Wrapping statements
    • 1-762
      Section 117.14: Wrapping Method Declarations
    • 1-763
      Section 117.15: Wrapping Expressions
    • 1-764
      Section 117.16: Whitespace
    • 1-765
      Section 117.17: Special Characters
    • 1-766
      Section 117.18: Variable Declarations
    • 1-767
      Chapter 118: Character encoding
    • 1-768
      Section 118.1: Reading text from a file encoded in UTF-8
    • 1-769
      Section 118.2: Writing text to a file in UTF-8
    • 1-770
      Section 118.3: Getting byte representation of a string in UTF-8
    • 1-771
      Chapter 119: Apache Commons Lang
    • 1-772
      Section 119.1: Implement equals() method
    • 1-773
      Section 119.2: Implement hashCode() method
    • 1-774
      Section 119.3: Implement toString() method
    • 1-775
      Chapter 120: Localization and Internationalization
    • 1-776
      Section 120.1: Locale
    • 1-777
      Section 120.2: Automatically formatted Dates using "locale"
    • 1-778
      Section 120.3: String Comparison
    • 1-779
      Chapter 121: Parallel programming with Fork/Join framework
    • 1-780
      Section 121.1: Fork/Join Tasks in Java
    • 1-781
      Chapter 122: Non-Access Modifiers
    • 1-782
      Section 122.1: final
    • 1-783
      Section 122.2: static
    • 1-784
      Section 122.3: abstract
    • 1-785
      Section 122.4: strictfp
    • 1-786
      Section 122.5: volatile
    • 1-787
      Section 122.6: synchronized
    • 1-788
      Section 122.7: transient
    • 1-789
      Chapter 123: Process
    • 1-790
      Section 123.1: Pitfall: Runtime.exec, Process and ProcessBuilder don't understand shell syntax
    • 1-791
      Section 123.2: Simple example (Java version < 1.5)
    • 1-792
      Chapter 124: Java Native Access
    • 1-793
      Section 124.1: Introduction to JNA
    • 1-794
      Chapter 125: Modules
    • 1-795
      Section 125.1: Defining a basic module
    • 1-796
      Chapter 126: Concurrent Programming (Threads)
    • 1-797
      Section 126.1: Callable and Future
    • 1-798
      Section 126.2: CountDownLatch
    • 1-799
      Section 126.3: Basic Multithreading
    • 1-800
      Section 126.4: Locks as Synchronisation aids
    • 1-801
      Section 126.5: Semaphore
    • 1-802
      Section 126.6: Synchronization
    • 1-803
      Section 126.7: Runnable Object
    • 1-804
      Section 126.8: Creating basic deadlocked system
    • 1-805
      Section 126.9: Creating a java.lang.Thread instance
    • 1-806
      Section 126.10: Atomic operations
    • 1-807
      Section 126.11: Exclusive write / Concurrent read access
    • 1-808
      Section 126.12: Producer-Consumer
    • 1-809
      Section 126.13: Visualizing read/write barriers while using synchronized / volatile
    • 1-810
      Section 126.14: Get status of all threads started by your program excluding system threads
    • 1-811
      Section 126.15: Using ThreadLocal
    • 1-812
      Section 126.16: Multiple producer/consumer example with shared global queue
    • 1-813
      Section 126.17: Add two `int` arrays using a Threadpool
    • 1-814
      Section 126.18: Pausing Execution
    • 1-815
      Section 126.19: Thread Interruption / Stopping Threads
    • 1-816
      Chapter 127: Executor, ExecutorService and Thread pools
    • 1-817
      Section 127.1: ThreadPoolExecutor
    • 1-818
      Section 127.2: Retrieving value from computation - Callable
    • 1-819
      Section 127.3: submit() vs execute() exception handling dierences
    • 1-820
      Section 127.4: Handle Rejected Execution
    • 1-821
      Section 127.5: Fire and Forget - Runnable Tasks
    • 1-822
      Section 127.6: Use cases for dierent types of concurrency constructs
    • 1-823
      Section 127.7: Wait for completion of all tasks in ExecutorService
    • 1-824
      Section 127.8: Use cases for dierent types of ExecutorService
    • 1-825
      Section 127.9: Scheduling tasks to run at a fixed time, after a delay or repeatedly
    • 1-826
      Section 127.10: Using Thread Pools
    • 1-827
      Chapter 128: ThreadLocal
    • 1-828
      Section 128.1: Basic ThreadLocal usage
    • 1-829
      Section 128.2: ThreadLocal Java 8 functional initialization
    • 1-830
      Section 128.3: Multiple threads with one shared object
    • 1-831
      Chapter 129: Using ThreadPoolExecutor in MultiThreaded applications.
    • 1-832
      Section 129.1: Performing Asynchronous Tasks Where No Return Value Is Needed Using a Runnable Class Instance
    • 1-833
      Section 129.2: Performing Asynchronous Tasks Where a Return Value Is Needed Using a Callable Class Instance
    • 1-834
      Section 129.3: Defining Asynchronous Tasks Inline using Lambdas
    • 1-835
      Chapter 130: Common Java Pitfalls
    • 1-836
      Section 130.1: Pitfall: using == to compare primitive wrappers objects such as Integer
    • 1-837
      Section 130.2: Pitfall: using == to compare strings
    • 1-838
      Section 130.3: Pitfall: forgetting to free resources
    • 1-839
      Section 130.4: Pitfall: testing a file before attempting to open it
    • 1-840
      Section 130.5: Pitfall: thinking of variables as objects
    • 1-841
      Section 130.6: Pitfall: memory leaks
    • 1-842
      Section 130.7: Pitfall: Not understanding that String is an immutable class
    • 1-843
      Section 130.8: Pitfall: combining assignment and side-eects
    • 1-844
      Chapter 131: Java Pitfalls - Exception usage
    • 1-845
      Section 131.1: Pitfall - Catching Throwable, Exception, Error or RuntimeException
    • 1-846
      Section 131.2: Pitfall - Ignoring or squashing exceptions
    • 1-847
      Section 131.3: Pitfall - Throwing Throwable, Exception, Error or RuntimeException
    • 1-848
      Section 131.4: Pitfall - Using exceptions for normal flowcontrol
    • 1-849
      Section 131.5: Pitfall - Directly subclassing `Throwable`
    • 1-850
      Section 131.6: Pitfall - Catching InterruptedException
    • 1-851
      Section 131.7: Pitfall - Excessive or inappropriate stacktraces
    • 1-852
      Chapter 132: Java Pitfalls - Language syntax
    • 1-853
      Section 132.1: Pitfall - Missing a ‘break’ in a 'switch' case
    • 1-854
      Section 132.2: Pitfall - Declaring classes with the same names as standard classes
    • 1-855
      Section 132.3: Pitfall - Leaving out braces: the "dangling if" and "dangling else" problems
    • 1-856
      Section 132.4: Pitfall - Octal literals
    • 1-857
      Section 132.5: Pitfall - Using '==' to test a boolean
    • 1-858
      Section 132.6: Pitfall - Ignoring method visibility
    • 1-859
      Section 132.7: Pitfall: Using 'assert' for argument or user input validation
    • 1-860
      Section 132.8: Pitfall - Wildcard imports can make your code fragile
    • 1-861
      Section 132.9: Pitfall - Misplaced semicolons and missing braces
    • 1-862
      Section 132.10: Pitfall - Overloading instead of overriding
    • 1-863
      Section 132.11: Pitfall of Auto-Unboxing Null Objects into Primitives
    • 1-864
      Chapter 133: Java Pitfalls - Threads and Concurrency
    • 1-865
      Section 133.1: Pitfall - Extending 'java.lang.Thread'
    • 1-866
      Section 133.2: Pitfall - Too many threads makes an application slower
    • 1-867
      Section 133.3: Pitfall: incorrect use of wait() / notify()
    • 1-868
      Section 133.4: Pitfall: Shared variables require proper synchronization
    • 1-869
      Section 133.5: Pitfall - Thread creation is relatively expensive
    • 1-870
      Chapter 134: Java Pitfalls - Nulls and NullPointerException
    • 1-871
      Section 134.1: Pitfall - "Making good" unexpected nulls
    • 1-872
      Section 134.2: Pitfall - Using null to represent an empty array or collection
    • 1-873
      Section 134.3: Pitfall - Not checking if an I/O stream isn't even initialized when closing it
    • 1-874
      Section 134.4: Pitfall - Returning null instead of throwing an exception
    • 1-875
      Section 134.5: Pitfall - Unnecessary use of Primitive Wrappers can lead to NullPointerExceptions
    • 1-876
      Section 134.6: Pitfall - Using "Yoda notation" to avoid NullPointerException
    • 1-877
      Chapter 135: Java Pitfalls - Performance Issues
    • 1-878
      Section 135.1: Pitfall - String concatenation in a loop does not scale
    • 1-879
      Section 135.2: Pitfall - Using size() to test if a collection is empty is inecient
    • 1-880
      Section 135.3: Pitfall - Interning strings so that you can use == is a bad idea
    • 1-881
      Section 135.4: Pitfall - Using 'new' to create primitive wrapper instances is inecient
    • 1-882
      Section 135.5: Pitfall - Eciency concerns with regular expressions
    • 1-883
      Section 135.6: Pitfall - Small reads / writes on unbuered streams are inecient
    • 1-884
      Section 135.7: Pitfall - Over-use of primitive wrapper types is inecient
    • 1-885
      Section 135.8: Pitfall - The overheads of creating log messages
    • 1-886
      Section 135.9: Pitfall - Iterating a Map's keys can be inecient
    • 1-887
      Section 135.10: Pitfall - Calling System.gc() is inecient
    • 1-888
      Section 135.11: Pitfall - Calling 'new String(String)' is inecient
    • 1-889
      Chapter 136: ServiceLoader
    • 1-890
      Section 136.1: Simple ServiceLoader Example
    • 1-891
      Section 136.2: Logger Service
    • 1-892
      Chapter 137: Classloaders
    • 1-893
      Section 137.1: Implementing a custom classLoader
    • 1-894
      Section 137.2: Loading an external .class file
    • 1-895
      Section 137.3: Instantiating and using a classloader
    • 1-896
      Chapter 138: Creating Images Programmatically
    • 1-897
      Section 138.1: Creating a simple image programmatically and displaying it
    • 1-898
      Section 138.2: Save an Image to disk
    • 1-899
      Section 138.3: Setting individual pixel's color in BueredImage
    • 1-900
      Section 138.4: Specifying image rendering quality
    • 1-901
      Section 138.5: Creating an image with BueredImage class
    • 1-902
      Section 138.6: Editing and re-using image with BueredImage
    • 1-903
      Section 138.7: How to scale a BueredImage
    • 1-904
      Chapter 139: Atomic Types
    • 1-905
      Section 139.1: Creating Atomic Types
    • 1-906
      Section 139.2: Motivation for Atomic Types
    • 1-907
      Chapter 140: RSA Encryption
    • 1-908
      Section 140.1: An example using a hybrid cryptosystem consisting of OAEP and GCM
    • 1-909
      Chapter 141: Secure objects
    • 1-910
      Section 141.1: SealedObject (javax.crypto.SealedObject)
    • 1-911
      Section 141.2: SignedObject (java.security.SignedObject)
    • 1-912
      Chapter 142: Security & Cryptography
    • 1-913
      Section 142.1: Compute Cryptographic Hashes
    • 1-914
      Section 142.2: Encrypt and Decrypt Data with Public / Private Keys
    • 1-915
      Section 142.3: Generate Cryptographically Random Data
    • 1-916
      Section 142.4: Generate Public / Private Key Pairs
    • 1-917
      Section 142.5: Compute and Verify Digital Signatures
    • 1-918
      Chapter 143: Security & Cryptography
    • 1-919
      Section 143.1: The JCE
    • 1-920
      Section 143.2: Keys and Key Management
    • 1-921
      Section 143.3: Common Java vulnerabilities
    • 1-922
      Section 143.4: Networking Concerns
    • 1-923
      Section 143.5: Randomness and You
    • 1-924
      Section 143.6: Hashing and Validation
    • 1-925
      Chapter 144: SecurityManager
    • 1-926
      Section 144.1: Sandboxing classes loaded by a ClassLoader
    • 1-927
      Section 144.2: Enabling the SecurityManager
    • 1-928
      Section 144.3: Implementing policy deny rules
    • 1-929
      Chapter 145: JNDI
    • 1-930
      Section 145.1: RMI through JNDI
    • 1-931
      Chapter 146: sun.misc.Unsafe
    • 1-932
      Section 146.1: Instantiating sun.misc.Unsafe via reflection
    • 1-933
      Section 146.2: Instantiating sun.misc.Unsafe via bootclasspath
    • 1-934
      Section 146.3: Getting Instance of Unsafe
    • 1-935
      Section 146.4: Uses of Unsafe
    • 1-936
      Chapter 147: Java Memory Model
    • 1-937
      Section 147.1: Motivation for the Memory Model
    • 1-938
      Section 147.2: Happens-before relationships
    • 1-939
      Section 147.3: How to avoid needing to understand the Memory Model
    • 1-940
      Section 147.4: Happens-before reasoning applied to some examples
    • 1-941
      Chapter 148: Java deployment
    • 1-942
      Section 148.1: Making an executable JAR from the command line
    • 1-943
      Section 148.2: Creating an UberJAR for an application and its dependencies
    • 1-944
      Section 148.3: Creating JAR, WAR and EAR files
    • 1-945
      Section 148.4: Introduction to Java Web Start
    • 1-946
      Chapter 149: Java plugin system implementations
    • 1-947
      Section 149.1: Using URLClassLoader
    • 1-948
      Chapter 150: JavaBean
    • 1-949
      Section 150.1: Basic Java Bean
    • 1-950
      Chapter 151: Java SE 7 Features
    • 1-951
      Section 151.1: New Java SE 7 programming language features
    • 1-952
      Section 151.2: Binary Literals
    • 1-953
      Section 151.3: The try-with-resources statement
    • 1-954
      Section 151.4: Underscores in Numeric Literals
    • 1-955
      Section 151.5: Type Inference for Generic Instance Creation
    • 1-956
      Section 151.6: Strings in switch Statements
    • 1-957
      Chapter 152: Java SE 8 Features
    • 1-958
      Section 152.1: New Java SE 8 programming language features
    • 1-959
      Chapter 153: Dynamic Method Dispatch
    • 1-960
      Section 153.1: Dynamic Method Dispatch - Example Code
    • 1-961
      Chapter 154: Generating Java Code
    • 1-962
      Section 154.1: Generate POJO From JSON
    • 1-963
      Chapter 155: JShell
    • 1-964
      Section 155.1: Editting Snippets
    • 1-965
      Section 155.2: Entering and Exiting JShell
    • 1-966
      Section 155.3: Expressions
    • 1-967
      Section 155.4: Methods and Classes
    • 1-968
      Section 155.5: Variables
    • 1-969
      Chapter 156: Stack-Walking API
    • 1-970
      Section 156.1: Print all stack frames of the current thread
    • 1-971
      Section 156.2: Print current caller class
    • 1-972
      Section 156.3: Showing reflection and other hidden frames
    • 1-973
      Chapter 157: Sockets
    • 1-974
      Section 157.1: Read from socket
    • 1-975
      Chapter 158: Java Sockets
    • 1-976
      Section 158.1: A simple TCP echo back server
    • 1-977
      Chapter 159: FTP (File Transfer Protocol)
    • 1-978
      Section 159.1: Connecting and Logging Into a FTP Server
    • 1-979
      Chapter 160: Using Other Scripting Languages in Java
    • 1-980
      Section 160.1: Evaluating A JavaScript file in -scripting mode of nashorn
    • 1-981
      Chapter 161: C++ Comparison
    • 1-982
      Section 161.1: Static Class Members
    • 1-983
      Section 161.2: Classes Defined within Other Constructs
    • 1-984
      Section 161.3: Pass-by-value & Pass-by-reference
    • 1-985
      Section 161.4: Inheritance vs Composition
    • 1-986
      Section 161.5: Outcast Downcasting
    • 1-987
      Section 161.6: Abstract Methods & Classes
    • 1-988
      Chapter 162: Audio
    • 1-989
      Section 162.1: Play a MIDI file
    • 1-990
      Section 162.2: Play an Audio file Looped
    • 1-991
      Section 162.3: Basic audio output
    • 1-992
      Section 162.4: Bare metal sound
    • 1-993
      Chapter 163: Java Print Service
    • 1-994
      Section 163.1: Building the Doc that will be printed
    • 1-995
      Section 163.2: Discovering the available print services
    • 1-996
      Section 163.3: Defining print request attributes
    • 1-997
      Section 163.4: Listening print job request status change
    • 1-998
      Section 163.5: Discovering the default print service
    • 1-999
      Section 163.6: Creating a print job from a print service
    • 1-1000
      Chapter 164: CompletableFuture
    • 1-1001
      Section 164.1: Simple Example of CompletableFuture
    • 1-1002
      Chapter 165: Runtime Commands
    • 1-1003
      Section 165.1: Adding shutdown hooks
    • 1-1004
      Chapter 166: Unit Testing
    • 1-1005
      Section 166.1: What is Unit Testing?
    • 1-1006
      Chapter 167: Asserting
    • 1-1007
      Section 167.1: Checking arithmetic with assert
    • 1-1008
      Chapter 168: Multi-Release JAR Files
    • 1-1009
      Section 168.1: Example of a multi-release Jar file's contents
    • 1-1010
      Section 168.2: Creating a multi-release Jar using the jar tool
    • 1-1011
      Section 168.3: URL of a loaded class inside a multi-release Jar
    • 1-1012
      Chapter 169: Just in Time (JIT) compiler
    • 1-1013
      Section 169.1: Overview
    • 1-1014
      Chapter 170: Bytecode Modification
    • 1-1015
      Section 170.1: What is Bytecode?
    • 1-1016
      Section 170.2: How to edit jar files with ASM
    • 1-1017
      Section 170.3: How to load a ClassNode as a Class
    • 1-1018
      Section 170.4: How to rename classes in a jar file
    • 1-1019
      Section 170.5: Javassist Basic
    • 1-1020
      Chapter 171: Disassembling and Decompiling
    • 1-1021
      Section 171.1: Viewing bytecode with javap
    • 1-1022
      Chapter 172: JMX
    • 1-1023
      Section 172.1: Simple example with Platform MBean Server
    • 1-1024
      Chapter 173: Java Virtual Machine (JVM)
    • 1-1025
      Section 173.1: These are the basics
    • 1-1026
      Chapter 174: XJC
    • 1-1027
      Section 174.1: Generating Java code from simple XSD file
    • 1-1028
      Chapter 175: JVM Flags
    • 1-1029
      Section 175.1: -XXaggressive
    • 1-1030
      Section 175.2: -XXallocClearChunks
    • 1-1031
      Section 175.3: -XXallocClearChunkSize
    • 1-1032
      Section 175.4: -XXcallProfiling
    • 1-1033
      Section 175.5: -XXdisableFatSpin
    • 1-1034
      Section 175.6: -XXdisableGCHeuristics
    • 1-1035
      Section 175.7: -XXdumpSize
    • 1-1036
      Section 175.8: -XXexitOnOutOfMemory
    • 1-1037
      Chapter 176: JVM Tool Interface
    • 1-1038
      Section 176.1: Iterate over objects reachable from object (Heap 1.0)
    • 1-1039
      Section 176.2: Get JVMTI environment
    • 1-1040
      Section 176.3: Example of initialization inside of Agent_OnLoad method
    • 1-1041
      Chapter 177: Java Memory Management
    • 1-1042
      Section 177.1: Setting the Heap, PermGen and Stack sizes
    • 1-1043
      Section 177.2: Garbage collection
    • 1-1044
      Section 177.3: Memory leaks in Java
    • 1-1045
      Section 177.4: Finalization
    • 1-1046
      Section 177.5: Manually triggering GC
    • 1-1047
      Chapter 178: Java Performance Tuning
    • 1-1048
      Section 178.1: An evidence-based approach to Java performance tuning
    • 1-1049
      Section 178.2: Reducing amount of Strings
    • 1-1050
      Section 178.3: General approach
    • 1-1051
      Chapter 179: Benchmarks
    • 1-1052
      Section 179.1: Simple JMH example
    • 1-1053
      Chapter 180: FileUpload to AWS
    • 1-1054
      Section 180.1: Upload file to s3 bucket
    • 1-1055
      Chapter 181: AppDynamics and TIBCO BusinessWorks Instrumentation for Easy Integration
    • 1-1056
      Section 181.1: Example of Instrumentation of all BW Applications in a Single Step for Appdynamics
    • 1-1057
      Appendix A: Installing Java (Standard Edition)
    • 1-1058
      Section A.1: Setting %PATH% and %JAVA_HOME% after installing on Windows
    • 1-1059
      Section A.2: Installing a Java JDK on Linux
    • 1-1060
      Section A.3: Installing a Java JDK on macOS
    • 1-1061
      Section A.4: Installing a Java JDK or JRE on Windows
    • 1-1062
      Section A.5: Configuring and switching Java versions on Linux using alternatives
    • 1-1063
      Section A.6: What do I need for Java Development
    • 1-1064
      Section A.7: Selecting an appropriate Java SE release
    • 1-1065
      Section A.8: Java release and version naming
    • 1-1066
      Section A.9: Installing Oracle Java on Linux with latest tar file
    • 1-1067
      Section A.10: Post-installation checking and configuration on Linux
    • 1-1068
      Appendix B: Java Editions, Versions, Releases and Distributions
    • 1-1069
      Section B.1: Dierences between Java SE JRE or Java SE JDK distributions
    • 1-1070
      Section B.2: Java SE Versions
    • 1-1071
      Section B.3: Dierences between Java EE, Java SE, Java ME and JavaFX
    • 1-1072
      Appendix C: The Classpath
    • 1-1073
      Section C.1: Dierent ways to specify the classpath
    • 1-1074
      Section C.2: Adding all JARs in a directory to the classpath
    • 1-1075
      Section C.3: Load a resource from the classpath
    • 1-1076
      Section C.4: Classpath path syntax
    • 1-1077
      Section C.5: Dynamic Classpath
    • 1-1078
      Section C.6: Mapping classnames to pathnames
    • 1-1079
      Section C.7: The bootstrap classpath
    • 1-1080
      Section C.8: What the classpath means: how searches work
    • 1-1081
      Appendix D: Resources (on classpath)
    • 1-1082
      Section D.1: Loading default configuration
    • 1-1083
      Section D.2: Loading an image from a resource
    • 1-1084
      Section D.3: Finding and reading resources using a classloader
    • 1-1085
      Section D.4: Loading same-name resource from multiple JARs
    • 1-1086
      Credits
    • 1-1087
      You may also like

    常见问答

    您可以透過手機、平板或是電腦登入 HiSKIO 平台,在【我的學習】>【我的書籍】頁面,選擇想看的電子書。

    猜你喜欢

    用户评价

    | 收集中

    销售方案