𝔖 Scriptorium
✦   LIBER   ✦

📁

Java Programming Exercises: Volume One: Language Fundamentals and Core Concepts

✍ Scribed by Christian Ullenboom


Publisher
Chapman and Hall/CRC
Year
2024
Tongue
English
Leaves
321
Edition
1
Category
Library

⬇  Acquire This Volume

No coin nor oath required. For personal study only.

✦ Synopsis


Take the first step in raising your coding skills to the next level, and test your Java knowledge on tricky programming tasks, with the help of the pirate Captain CiaoCiao. This is the first of two volumes which provide you with everything you need to excel in your Java journey, including tricks that you should know in detail as a professional, as well as intensive training for clean code and thoughtful design that carries even complex software.

Features:

    • About 200 tasks with commented solutions on different levels

    • For all paradigms: object-oriented, imperative, and functional

    • Clean code, reading foreign code, and object-oriented modeling

    With numerous best practices and extensively commented solutions to the tasks, these books provide the perfect workout for professional software development with Java.

    ✦ Table of Contents


    Cover
    Half Title
    Title Page
    Copyright Page
    Table of Contents
    About the Author
    Introduction
    Previous Knowledge and Target Audience
    Working with This Book
    The Suggested Solutions
    Use of This Book
    Required Software
    Used Java Version in the Book
    JVM
    Development Environment
    Conventions
    Helping Captain CiaoCiao and Bonny Brain
    1 Introduction to the Java Ecosystem
    Bytecode and JVM
    Porting Java Programs
    Tools for Java Developers
    Get to Know Error Messages of the IDE
    Suggested Solutions
    Porting Java Programs
    Get to Know Error Messages of the IDE
    2 Imperative Programming
    Screen Output
    Learn about the SVG Specification
    Write an SVG Circle on the Console
    Variables and Data Types
    Access Variables and Output Their Assignments
    Quiz: Value Ranges
    Quiz: Does This Add Up?
    Generate Random Circles
    Quiz: Dazed and Confused
    Process User Input
    Expressions, Operands, and Operators
    Quiz: Check In-Between
    Check If Loot Can Be Shared Fairly
    Do Two Numbers Share the Same Digit?
    Convert Currency Amount to Coins
    One Bottle of Rum, Ten Bottles of Rum
    Quiz: The Zero Effect
    Control Flow
    Payday
    Quiz: Wrong Branching
    Convert Liters
    Create SVG Circles with Random Colors
    Quiz: To Which Block Does the Else Belong?
    Quiz: Recognize Negative Days and Hours
    Evaluate Input Strings for Approval
    Rewrite Switch Statement to Switch Expression
    Loops
    Create Rotated SVG Rectangles
    Create SVG-Pearl-Chain
    Sum Numbers from the Command Line
    Go through a Mathematical Phenomenon
    Quiz: How Many Stars?
    Calculate Products for Faculties
    Determine If a Number Is Formed by Factorial
    Find the Smallest and Largest Digit of a Number
    Quiz: Not Like This from 1 to 100
    A Flag in the Wind through Nested Loops
    Output Simple Chessboard
    It’s Christmastime: Displaying Trees with Ornaments
    Draw Fishy Stitching Motifs
    Trying Instead of Thinking
    Get the Number of Digits of a Number
    Methods
    Drawing Hearts
    Implement Overloaded Line Methods
    Standing Straight
    Create a Multiplication Table
    Cistercian Numerals Script
    Quiz: What Does Ding-Dong Do? (Recursion)
    Quiz: Repdigit (Recursion)
    Calculate Collatz Sequence (Recursion)
    Ancient Egyptian Multiplication (Recursion)
    Suggested Solutions
    Write an SVG Circle on the Console
    Access Variables and Output Their Assignments
    Quiz: Value Ranges
    Quiz: Does This Add Up?
    Generate Random Circles
    Quiz: Dazed and Confused
    Process User Input
    Quiz: Check In-Between
    Check If Loot Can Be Shared Fairly
    Do Two Numbers Share the Same Digit?
    Convert Currency Amount to Coins
    One Bottle of Rum, Ten Bottles of Rum
    Quiz: The Zero Effect
    Payday
    Quiz: Wrong Branching
    Convert Liters
    Create SVG Circles with Random Colors
    Quiz: To Which Block Does the Else Belong?
    Quiz: Recognize Negative Days and Hours
    Evaluate Input Strings for Approval
    Rewrite Switch Statement to Switch Expression
    Create Rotated SVG Rectangles
    Create SVG-Pearl-Chain
    Sum Numbers from the Command Line
    Go through a Mathematical Phenomenon
    Quiz: How Many Stars?
    Calculate Products for Faculties
    Determine If a Number Is Formed by Factorial
    Find the Smallest and Largest Digit of a Number
    Quiz: Not Like This from 1 to 100
    A Flag in the Wind through Nested Loops
    Output Simple Chessboard
    It’s Christmastime: Displaying Trees with Ornaments
    Draw Fishy Stitching Motifs
    Trying Instead of Thinking
    Get the Number of Digits of a Number
    Drawing Hearts
    Implement Overloaded Line Methods
    Standing Straight
    Create a Multiplication Table
    Cistercian Numerals Script
    Quiz: What Does Ding-Dong Do? (Recursion)
    Quiz: Repdigit (Recursion)
    Calculate Collatz Sequence (Recursion)
    Ancient Egyptian Multiplication (Recursion)
    3 Classes, Objects, and Packages
    Creating Objects
    Draw Polygons
    Working with References
    Quiz: The Short Life of Points
    Build Triangles
    Quiz: == vs. equals(…)
    Quiz: Protect against NullPointerException
    Suggested Solutions
    Draw Polygons
    Quiz: The Short Life of Points
    Build Triangles
    Quiz: == vs. equals(…)
    Quiz: Protect against NullPointerException
    Note
    4 Arrays
    Everything Has a Type
    Quiz: Array Types
    One-Dimensional Arrays
    Loop Arrays and Output Wind Speed, Wind Direction
    Detect Continuous Revenue Growth
    Array of Points
    Search Consecutive Strings and Determine If Salty Snook Is Coming
    Reverse an Array
    Find the Nearest Cinema
    Raid the Candy Store and Share Fairly
    Enhanced for Loop
    Numbers Well Shuffled
    Draw Mountains
    Two- and Multidimensional Arrays
    Check Mini-Sudoku for Valid Solution
    Enlarge Image
    Variable Argument Lists
    Create SVG Polygons with a Variable Number of Coordinates
    Check for Approval
    Help, Tetraphobia! Put All Fours Last
    The Utility Class Arrays
    Quiz: Copy Arrays
    Quiz: Compare Arrays
    Suggested Solutions
    Quiz: Array Types
    Loop Arrays and Output Wind Speed, Wind Direction
    Reverse an Array
    Array of Points
    Search Consecutive Strings and Determine if Salty Snook is Coming
    Reverse an Array
    Find the Nearest Cinema
    Raid the Candy Store and Share Fairly
    Draw Mountains
    Check Mini-Sudoku for Valid Solution
    Enlarge Image
    Create SVG Polygons with Variable Number of Coordinates
    Check for Approval
    Help, Tetraphobia! Put All Fours Last
    Quiz: Copy Arrays
    Quiz: Compare Arrays
    5 Character and String Processing
    The String Class and Its Members
    Quiz: Is String a Built-In Keyword?
    Building HTML Elements with Simple Concatenation
    Check Safe Transmission by Doubling Characters
    Swap Y and Z
    Give Defiant Answers
    Quiz: String Comparisons with == and Equals(…)
    Quiz: Is Equals(…) Symmetric?
    Test Strings for Palindrome Property
    Check if Captain CiaoCiao is in the Middle
    Find the Shortest Name in the Array
    Count String Occurrences
    Determine the Larger Crew Size
    Build Diamonds
    Check for a Good Password
    Bake Peanut Butter Cookies
    Calculate Sum of Digits
    Decolumnize Texts
    Draw a Meadow with Favorite Flowers
    Detect Repetitions
    Constrain Line Boundaries and Wrap Lines
    Quiz: How Many String Objects?
    Test If the Fruit Is Wrapped in Chocolate
    From Top to Bottom, from Left to Right
    Dynamic Strings with StringBuilder
    Fill Strings
    Practicing the Alphabet with a Parrot
    Quiz: Lightly Attached
    Convert Number to Textual Unary Encoding
    Lose Weight by Moving Digits
    Remove Vowels
    Don’t Shoot the Messenger
    Compress Repeated Spaces
    Insert and Remove Crackles and Pops
    Split CamelCase Strings
    Underline Words
    Implement Caesar Encryption
    Suggested Solutions
    Quiz: Is String a Built-In Keyword?
    Building HTML Elements with Simple Concatenation
    Check Safe Transmission by Doubling Characters
    Swap Y and Z
    Give Defiant Answers
    Quiz: String Comparisons with == and Equals(…)
    Quiz: Is Equals(…) Symmetric?
    Test Strings for Palindrome Property
    Check if Captain CiaoCiao is in the Middle
    Find the Shortest Name in the Array
    Count String Occurrences
    Determine the Larger Crew Size
    Build Diamonds
    Check for a Good Password
    Bake Peanut Butter Cookies
    Calculate Sum of Digits
    Decolumnize Texts
    Draw a Meadow with Favorite Flowers
    Detect Repetitions
    Constrain Line Boundaries and Wrap Lines
    Quiz: How Many String Objects?
    Test if the Fruit is Wrapped in Chocolate
    From Top to Bottom, from Left to Right
    Fill Strings
    Practicing the Alphabet with a Parrot
    Quiz: Lightly Attached
    Convert Number to Textual Unary Encoding
    Lose Weight by Moving Digits
    Remove Vowels
    Don’t Shoot the Messenger
    Compress Repeated Spaces
    Insert and Remove Crackles and Pops
    Split CamelCase Strings
    Underline Words
    Implement Caesar Encryption
    6 Writing Your Own Classes
    Class Declaration and Object Properties
    Declare Radio with Instance Variables and a Main Program
    Implementing Methods of a Radio
    Private Parts: Make Instance Variables Private
    Create Setters and Getters
    Static Variables Methods
    Convert Station Names to Frequencies
    Write Log Output with a Tracer Class
    Quiz: Nothing Stolen
    Simple Enumerations
    Give Radio an AM–FM Modulation
    Set Valid Start and End Frequency for Modulation
    Constructors
    Writing Radio Constructors
    Implement Copy Constructor
    Realize Factory Methods
    Associations
    Connect Monitor Tube with TV
    Quiz: Association, Composition, and Aggregation
    Add Radios with a 1:n Association to the Ship
    Inheritance
    Introduce Abstraction into Electrical Devices via Inheritance
    Quiz: Three, Two, and One
    Quiz: Private and Protected Constructor
    Determine the Number of Switched on Electrical Devices
    Ship Should Hold Any Electronic Device
    Take Working Radios on the Ship
    Solve Equivalence Test with Pattern Variable
    Fire Alarm Does Not Go Off: Overriding Methods
    Calling the Methods of the Superclass
    Polymorphism and Dynamic Binding
    Holiday! Switch Off All Devices
    The Big Move
    Quiz: Bumbo Is a Great Drink
    Quiz: Vodka with Taste
    Quiz: Rum-Paradise
    Abstract Classes and Abstract Methods
    Quiz: Consumer Devices as an Abstract Superclass?
    TimerTask as an Example for an Abstract Class
    Suggested Solutions
    Declare Radio with Instance Variables and a Main Program
    Implementing Methods of a Radio
    Private Parts: Make Instance Variables Private
    Create Setters and Getters
    Convert Station Names to Frequencies
    Write Log Output with a Tracer Class
    Quiz: Nothing Stolen
    Give Radio an AM–FM Modulation
    Set Valid Start and End Frequency for Modulation
    Writing Radio Constructors
    Implement Copy Constructor
    Realize Factory Methods
    Connect Monitor Tube with TV
    Quiz: Association, Composition, and Aggregation
    Add Radios with a 1:n Association to the Ship
    Introduce Abstraction into Electrical Devices via Inheritance
    Quiz: Three, Two, and One
    Quiz: Private and Protected Constructor
    Determine Number of Switched on Electrical Devices
    Ship Should Hold Any Electronic Device
    Take Working Radios on the Ship
    Solve Equivalence Test with Pattern Variable
    Fire Alarm Does Not Go Off: Overriding Methods
    Calling the Methods of the Superclass
    Holiday! Switch Off All Devices
    The Big Move
    Quiz: Bumbo Is a Great Drink
    Quiz: Vodka with Taste
    Quiz: Rum-Paradise
    Quiz: Consumer Devices as an Abstract Superclass?
    TimerTask as an Example for an Abstract Class
    Note
    7 Records, Interfaces, Enumerations, and Sealed Classes
    Records
    Quiz: Which Statements Are True for Records?
    Develop Record for Complex Numbers
    Quiz: Records with Static Variables
    Record Patterns
    Interfaces
    Compare Consumption of Electrical Devices
    Find Electronic Devices with the Highest Power Consumption
    Use Comparator Interface for Sorting
    Static and Default Methods in Interfaces
    Delete Selected Elements with Predicate
    Enumeration Types (enum)
    Enumeration for Candy
    Deliver Random Candies
    Tagging Candy with Addictive Value
    Interface Implementations via an enum
    Quiz: Aviso and Brig
    Suggested Solutions
    Quiz: Which Statements Are True for Records?
    Quiz: Records with Static Variables
    Quiz: Records with Static Variables
    Compare Consumption of Electrical Devices
    Find Electronic Devices with the Highest Power Consumption
    Use Comparator Interface for Sorting
    Static and Default Methods in Interfaces
    Delete Selected Elements with Predicate
    Enumeration for Candy
    Deliver Random Candies
    Tagging Candy with Addictive Value
    Interface Implementations via an enum
    Quiz: Aviso and Brig
    8 Nested Types
    Declare Nested Types
    Set AM–FM Modulation to Radio Type
    Write Three Kinds of Watt-Comparator Implementations
    Nested Types Quiz
    Quiz: Pirate Could Have Waved
    Quiz: Name in a Bottle
    Quiz: Get Me Another Bottle of Rum
    Suggested Solutions
    Set AM–FM Modulation to Radio Type
    Write Three Kinds of Watt-Comparator Implementations
    Quiz: Pirate Could Have Waved
    Quiz: Name in a Bottle
    Quiz: Get Me another Bottle of Rum
    9 Exception Handling
    Catching Exceptions
    Get the Longest Line of a File
    Identify Exceptions, Laughing All the Time
    Convert String Array to Int Array and Be Lenient on Nonnumbers
    Quiz: And Finally
    Quiz: A Lonely Try
    Quiz: Well Caught
    Quiz: Too Much of a Good Thing
    Quiz: Try-Catch in Inheritance
    Throwing Custom Exceptions
    Quiz: Throw and Throws
    Quiz: The Division Fails
    Writing Your Own Exception Classes
    Show Impossible Watt with Own Exception
    Quiz: Potatoes or Other Vegetables
    Try-with-Resources
    Write Current Date to File
    Read Notes and Write Them to a New ABC File
    Quiz: Excluded
    Suggested Solutions
    Get the Longest Line of a File
    Identify Exceptions, Laughing All the Time
    Convert String Array to Int Array and Be Lenient on Nonnumbers
    Quiz: And Finally
    Quiz: A Lonely Try
    Quiz: Well Caught
    Quiz: Too Much of a Good Thing
    Quiz: Try-Catch in Inheritance
    Quiz: Throw and Throws
    Quiz: The Division Fails
    Show Impossible Watt with Own Exception
    Quiz: Potatoes or Other Vegetables
    Write Current Date to File
    Read Notes and Write Them to a New ABC File
    Quiz: Excluded
    10 Lambda Expressions and Functional Programming
    Lambda Expressions
    Quiz: Recognize Valid Functional Interfaces
    Quiz: From Interface Implementation to Lambda Expression
    Write Lambda Expressions for Functional Interfaces
    Quiz: Write Lambda Expressions Like This?
    Developing Lambda Expressions
    Quiz: Contents of the Package java.util.function
    Quiz: Know Functional Interfaces for Mappings
    Method and Constructor References
    Rewriting Lambda Expressions
    Selected Functional Interfaces
    Delete Entries, Remove Comments, Convert to CSV
    Suggested Solutions
    Quiz: Recognize Valid Functional Interfaces
    Quiz: From Interface Implementation to Lambda Expression
    Write Lambda Expressions for Functional Interfaces
    Quiz: Write Lambda Expressions Like This?
    Developing Lambda Expressions
    Quiz: Contents of the Package java.util.function
    Quiz: Know Functional Interfaces for Mappings
    Rewriting Lambda Expressions
    Delete Entries, Remove Comments, and Convert to CSV
    Note
    11 Special Types from the Java Class Library
    Absolute Superclass java.lang.Object
    Generate equals(Object) and hashCode()
    Existing equals(Object) Implementations
    Interfaces Comparator and Comparable
    Quiz: Natural Order Or Not?
    Handle Superheroes
    Compare Superheroes
    Concatenate Hero Comparators
    Using a Key Extractor to Easily Create a Comparator
    Sort Points by Distance to Center
    Find Stores Nearby
    Autoboxing
    Quiz: Handling Null Reference in Unboxing
    Quiz: Unboxing Surprise
    Suggested Solutions
    Generate equals(Object) and hashCode()
    Existing equals(Object) Implementations
    Quiz: Natural Order Or Not?
    Compare Superheroes
    Concatenate Hero Comparators
    Using a Key Extractor to Easily Create a Comparator
    Sort Points by Distance to Center
    Find Stores Nearby
    Quiz: Handling Null Reference in Unboxing
    Quiz: Unboxing Surprise
    Notes
    Appendix A: Most Frequent Types and Methods in the Java Universe
    A.1 Packages with the Most Common Types
    A.2 100 Most Common Types
    A.3 100 Most Common Methods
    A.4 100 Most Common Methods Including Parameter List

    ✦ Subjects


    Computer Programming; Java Programming Language; Imperative Programming; Object-Oriented Programming; Functional Programming; Java Programming Exercises


    📜 SIMILAR VOLUMES


    Java Programming Exercises: Volume One:
    ✍ Christian Ullenboom 📂 Library 📅 2024 🏛 Chapman and Hall/CRC 🌐 English

    <p><span>Take the first step in raising your coding skills to the next level, and test your Java knowledge on tricky programming tasks, with the help of the pirate </span><span>Captain CiaoCiao</span><span>. This is the first of two volumes which provide you with everything you need to excel in your

    Java Programming Exercises: Volume One:
    ✍ Christian Ullenboom 📂 Library 📅 2024 🏛 Chapman and Hall/CRC 🌐 English

    <p><span>Take the first step in raising your coding skills to the next level, and test your Java knowledge on tricky programming tasks, with the help of the pirate </span><span>Captain CiaoCiao</span><span>. This is the first of two volumes which provide you with everything you need to excel in your

    Core Java Volume I--Fundamentals
    ✍ Cay S. Horstmann, Gary Cornell 📂 Library 📅 2012 🏛 Prentice Hall 🌐 English

    Fully updated to reflect Java SE 7 language changes, Core Java™, Volume I—Fundamentals, Ninth Edition, is the definitive guide to the Java platform.   Designed for serious programmers, this reliable, unbiased, no-nonsense tutorial illuminates key Java language and library features with thorou

    Core Java Volume I--Fundamentals
    ✍ Cay S. Horstmann, Gary Cornell 📂 Library 📅 2012 🏛 Prentice Hall 🌐 English

    Fully updated to reflect Java SE 7 language changes, Core Java, Volume I—Fundamentals, Ninth Edition, is the definitive guide to the Java platform.<br>Designed for serious programmers, this reliable, unbiased, no-nonsense tutorial illuminates key Java language and library features with thoroughly te

    Core Java Volume I--Fundamentals
    ✍ Cay S. Horstmann, Gary Cornell 📂 Library 📅 2012 🏛 Prentice Hall 🌐 English

    <P style="MARGIN: 0px">Fully updated to reflect Java SE 7 language changes, <B> <I> <B>Core Java™, Volume I—Fundamentals, Ninth Edition,</B> </I> </B> is the definitive guide to the Java platform. </P> <P style="MARGIN: 0px"> </P> <P style="MARGIN: 0px">Designed for serious programmers, this relia

    Core Java, Volume I--Fundamentals
    ✍ Cay S. Horstmann, Gary Cornell 📂 Library 📅 2007 🏛 Prentice Hall 🌐 English

    <P style="MARGIN: 0px">This revised edition of the classic <B> <I>Core Java™, Volume I–Fundamentals</I> </B>, is the definitive guide to Java for serious programmers who want to put Java to work on real projects.</P> <P style="MARGIN: 0px"> </P> <P style="MARGIN: 0px">Fully updated for the new Jav