Java Notes for Professionals book

    Amazing collection of free programming books

    Collecting
    Free
    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/

    Content

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

    FAQ

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

    Recommendations

    Reviews

    | Collecting

    Sales Plans