{"product_id":"fundamentals-of-java-programming-9783030077853","title":"Fundamentals of Java Programming","description":"\u003cb\u003eBook Synopsis\u003c\/b\u003e\u003cbr\u003eMaking extensive use of examples, this textbook on Java programming  teaches the fundamental skills for getting started in a command-line  environment. Meant to be used for a one-semester course to build solid  foundations in Java, \u003ci\u003eFundamentals of Java Programming \u003c\/i\u003eeschews second-semester content to concentrate on over 180 code examples and 250 exercises.\u003cp\u003eKey  object classes (String, Scanner, PrintStream, Arrays, and File) are  included to get started in Java programming. The programs are explained  with almost line-by-line descriptions, also with chapter-by-chapter  coding exercises.\u003c\/p\u003eTeaching resources include solutions to the exercises, as well as digital lecture slides.\u003cbr\u003e\u003cbr\u003e\u003cb\u003eTable of Contents\u003c\/b\u003e\u003cbr\u003e\u003cp\u003e1)        \u003cb\u003eProgramming Basics                                                                                                1\u003c\/b\u003e\u003c\/p\u003e  a)       \u003cb\u003eJava and the Java Virtual Machine                                                                               3\u003c\/b\u003e\u003cp\u003e\u003c\/p\u003e  \u003cp\u003e1.1   Computers and Their Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     3\u003c\/p\u003e  \u003cp\u003e1.1.1    The computer programs in your machine   . . . . . . . . . . . . . . . . . . . .     3\u003c\/p\u003e  \u003cp\u003e1.1.2    Java Virtual Machines - JVM . . . . . . . . . . . . . . . . . . . . . . . . . . .     3\u003c\/p\u003e  \u003cp\u003e1.1.3   Code editing and code compiling  . . . . . . . . . . . . . . . . . . . . . . . . .    6\u003c\/p\u003e  \u003cp\u003eb)      \u003cb\u003eOur First Programs                                                                                                      13\u003c\/b\u003e\u003c\/p\u003e  \u003cp\u003e2.1   The First Program, “Hello, World!”   . . . . . . . . . . . . . . . . . . . . . . . . . . .   13\u003c\/p\u003e  \u003cp\u003e2.1.1    Method declaration   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   16\u003c\/p\u003e  \u003cp\u003e2.1.2    Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   16\u003c\/p\u003e  \u003cp\u003e2.1.3   System.out.println and System.out.print . . . . . . . . . . . . . . . . . .  17\u003c\/p\u003e  \u003cp\u003e2.1.4    Spacing in the source code . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   18\u003c\/p\u003e  \u003cp\u003e2.2   Commenting   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   19\u003c\/p\u003e  \u003cp\u003e2.3   Errors  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   21\u003c\/p\u003e  \u003cp\u003e2.4   Using Multiple Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   23\u003c\/p\u003e  \u003cp\u003e•              println versus print revisited . . . . . . . . . . . . . . . . . . . . . . . . . .  23\u003c\/p\u003e  \u003cp\u003e•              Printing multiple-line texts on the screen   . . . . . . . . . . . . . . . . . . . .   25\u003c\/p\u003e  \u003cp\u003e2.4.3    Escaping characters   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   26\u003c\/p\u003e  2.4.4   Printing shapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  29\u003cp\u003e\u003c\/p\u003e  \u003cp\u003ec)       \u003cb\u003eUsing Data for Computation                                                                                       39\u003c\/b\u003e\u003c\/p\u003e  \u003cp\u003e3.1   Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   39\u003c\/p\u003e  \u003cp\u003e3.1.1   Data and their taxonomy  . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   39\u003c\/p\u003e  \u003cp\u003e3.1.2   Literals  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   40\u003c\/p\u003e  \u003cp\u003e3.1.3    Variable declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   42\u003c\/p\u003e  \u003cp\u003e3.1.4    Naming variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   43\u003c\/p\u003e  3.1.5    Value assignments   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   43\u003cp\u003e\u003c\/p\u003e  \u003cp\u003e3.2   The primitive data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   45\u003c\/p\u003e  \u003cp\u003e3.2.1    Quarterbacks program again   . . . . . . . . . . . . . . . . . . . . . . . . . . .   48\u003c\/p\u003e  \u003cp\u003e3.3       Using Variables for Computation  . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   50\u003c\/p\u003e  \u003cp\u003e3.3.1   Number arithmetics  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   50\u003c\/p\u003e  3.3.2   Formula evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   52\u003cp\u003e\u003c\/p\u003e  \u003cp\u003e3.3.3       Our first calculation program  . . . . . . . . . . . . . . . . . . . . . . . . . . .   53\u003c\/p\u003e  \u003cp\u003e3.3.4       Mixing different number types   . . . . . . . . . . . . . . . . . . . . . . . . . .   57\u003c\/p\u003e  3.3.5       Computing the Body-Mass Index . . . . . . . . . . . . . . . . . . . . . . . . .   59\u003cp\u003e\u003c\/p\u003e  \u003cp\u003e3.3.6        Sum of integers from 1 to 100 `a la Gauss   . . . . . . . . . . . . . . . . . . . .   61\u003c\/p\u003e  \u003cp\u003e3.3.7   Simplified expressions  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   63\u003c\/p\u003e  \u003cp\u003e3.4       An Introduction to String Objects   . . . . . . . . . . . . . . . . . . . . . . . . . . . .   69\u003c\/p\u003e  \u003cp\u003e3.4.1    String objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   69\u003c\/p\u003e  \u003cp\u003e3.4.2   String additions   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   73\u003c\/p\u003e  \u003cp\u003e3.4.3    Escaping   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   76\u003c\/p\u003e  \u003cp\u003e3.4.4    Connection with other types   . . . . . . . . . . . . . . . . . . . . . . . . . . .   76\u003c\/p\u003e  \u003cp\u003e\u003cb\u003e4     \u003c\/b\u003e\u003cb\u003eReading Keyboard Input                                                                                              83\u003c\/b\u003e\u003c\/p\u003e  \u003cp\u003e4.1   The Class Scanner  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   83\u003c\/p\u003e  \u003cp\u003e4.2   Reading input with a Scanner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   84\u003c\/p\u003e  \u003cp\u003e\u003cb\u003e5     \u003c\/b\u003e\u003cb\u003eDecomposing Code into Components                                                                             99\u003c\/b\u003e\u003c\/p\u003e  5.1   Code Decomposition  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   99\u003cp\u003e\u003c\/p\u003e  \u003cp\u003e5.1.1    Printing rectangles  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   99\u003c\/p\u003e  \u003cp\u003e5.1.2    Quadrangle  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106\u003c\/p\u003e  \u003cp\u003e5.1.3   Old MacDonald Had a Farm   . . . . . . . . . . . . . . . . . . . . . . . . . . . 108\u003c\/p\u003e  \u003cp\u003e5.1.4    The benefits of code decomposition . . . . . . . . . . . . . . . . . . . . . . . . 114\u003c\/p\u003e  \u003cp\u003e5.2   Using Multiple Program Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117\u003c\/p\u003e  \u003cp\u003e\u003cb\u003e6     \u003c\/b\u003e\u003cb\u003eP\u003c\/b\u003e\u003cb\u003eassing Values to and from Methods                                                                      123\u003c\/b\u003e\u003c\/p\u003e  \u003cp\u003e6.1   Passing Values to Methods   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123\u003c\/p\u003e  6.1.1    Methods that work with parameters  . . . . . . . . . . . . . . . . . . . . . . . 123\u003cp\u003e\u003c\/p\u003e  6.1.2    Method overloading   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128\u003cp\u003e\u003c\/p\u003e  \u003cp\u003e6.2   Receiving a Value from a Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132\u003c\/p\u003e  \u003cp\u003e6.3   Class Math   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137\u003c\/p\u003e  6.3.1        Mathematical functions in Java . . . . . . . . . . . . . . . . . . . . . . . . . . 137\u003cp\u003e\u003c\/p\u003e  \u003cp\u003e6.3.2        Application using Math methods  . . . . . . . . . . . . . . . . . . . . . . . . . 146\u003c\/p\u003e  \u003cp\u003e2)           \u003cb\u003eLoops and Conditional Execution                                                                    157\u003c\/b\u003e\u003c\/p\u003e  \u003cp\u003e\u003cb\u003e7     \u003c\/b\u003e\u003cb\u003eF\u003c\/b\u003e\u003cb\u003eor-Loops                                                                                                                           159\u003c\/b\u003e\u003c\/p\u003e  \u003cp\u003e7.1   Repetitive Code Execution   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159\u003c\/p\u003e  \u003cp\u003e7.2   Iteration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167\u003c\/p\u003e  \u003cp\u003e7.2.1   Simple iteration   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167\u003c\/p\u003e  \u003cp\u003e7.2.2    Iteration with an auxiliary variable . . . . . . . . . . . . . . . . . . . . . . . . 173\u003c\/p\u003e  \u003cp\u003e7.3   Double For-Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174\u003c\/p\u003e  \u003cp\u003e\u003cb\u003e8     \u003c\/b\u003e\u003cb\u003eUsing Conditions to Control the Flow                                                                     187\u003c\/b\u003e\u003c\/p\u003e  \u003cp\u003e8.1   Condition and its evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187\u003c\/p\u003e  8.2   The If Statements   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194\u003cp\u003e\u003c\/p\u003e  \u003cp\u003e8.2.1   If . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194\u003c\/p\u003e  \u003cp\u003e8.2.2    Else  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201\u003c\/p\u003e  \u003cp\u003e8.2.3   Special conditional evaluation rules . . . . . . . . . . . . . . . . . . . . . . . . 209\u003c\/p\u003e  \u003cp\u003e8.3   Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211\u003c\/p\u003e  \u003cp\u003e8.3.1   Computing max and min in a series of numbers . . . . . . . . . . . . . . . . . 211\u003c\/p\u003e   \u003cbr\u003e   \u003cp\u003e \u003c\/p\u003e  \u003cp\u003e8.3.2   A betting game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214\u003c\/p\u003e  \u003cp\u003e\u003cb\u003e9     \u003c\/b\u003e\u003cb\u003eF\u003c\/b\u003e\u003cb\u003eormatted Printing using \u003c\/b\u003eprintf                                      \u003cb\u003e225\u003c\/b\u003e\u003c\/p\u003e  \u003cp\u003e9.1   Formatted Printing of Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225\u003c\/p\u003e  \u003cp\u003e9.2   Formatted Printing of Integers   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228\u003c\/p\u003e  \u003cp\u003e9.3   Formatted Printing of Floating Point Numbers  . . . . . . . . . . . . . . . . . . . . . 229\u003c\/p\u003e  \u003cp\u003e\u003cb\u003e10  \u003c\/b\u003e\u003cb\u003eString Methods for Text Processing                                                                        237\u003c\/b\u003e\u003c\/p\u003e  \u003cp\u003e10.1 String Methods for Information Extraction   . . . . . . . . . . . . . . . . . . . . . . . 237\u003c\/p\u003e  10.2 String Methods for Comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239\u003cp\u003e\u003c\/p\u003e  \u003cp\u003e10.3   String methods for Pattern Search   . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244\u003c\/p\u003e  \u003cp\u003e10.4   String methods for creating new String objects  . . . . . . . . . . . . . . . . . . . . 246\u003c\/p\u003e  \u003cp\u003e10.5 Class StringBuilder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249\u003c\/p\u003e  \u003cp\u003e\u003cb\u003e11  \u003c\/b\u003e\u003cb\u003eBranching Using Switch Statements                                                                        259\u003c\/b\u003e\u003c\/p\u003e  \u003cp\u003e11.1 Switch Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259\u003c\/p\u003e  \u003cp\u003e11.2 Switching on a Char or a String Value  . . . . . . . . . . . . . . . . . . . . . . . . . . 266\u003c\/p\u003e  \u003cp\u003e\u003cb\u003e12  \u003c\/b\u003e\u003cb\u003eWhile and Do-while Loops                                                                                        277\u003c\/b\u003e\u003c\/p\u003e  \u003cp\u003e12.1 The While Loop   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277\u003c\/p\u003e  \u003cp\u003e12.1.1  What is a while-loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277\u003c\/p\u003e  \u003cp\u003e12.1.2  Collect numbers until the total reaches a target . . . . . . . . . . . . . . . . . 279\u003c\/p\u003e  \u003cp\u003e12.1.3  Integer overflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281\u003c\/p\u003e  \u003cp\u003e12.1.4  Vending machines   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283\u003c\/p\u003e  \u003cp\u003e12.1.5  The Collatz Conjecture   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285\u003c\/p\u003e  \u003cp\u003e12.1.6  From decimal to binary   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289\u003c\/p\u003e  \u003cp\u003e12.2 Do-while statements  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293\u003c\/p\u003e  \u003cp\u003e12.2.1  Do-while versus while  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293\u003c\/p\u003e  \u003cp\u003e12.2.2  Waiting for Godot  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294\u003c\/p\u003e  \u003cp\u003e12.2.3  Converting to binary, again  . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295\u003c\/p\u003e  \u003cp\u003e12.3 Terminating a Scanner of Keyboard   . . . . . . . . . . . . . . . . . . . . . . . . . . . 296\u003c\/p\u003e  \u003cp\u003e12.4 Approximating the Square Root   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301\u003c\/p\u003e  \u003cp\u003e\u003cb\u003eII\u003c\/b\u003e\u003cb\u003eI   \u003c\/b\u003e\u003cb\u003eArrays                                                                                                 311\u003c\/b\u003e\u003c\/p\u003e  \u003cp\u003e\u003cb\u003e13  \u003c\/b\u003e\u003cb\u003eArrays                                                                                                                           313\u003c\/b\u003e\u003c\/p\u003e  \u003cp\u003e13.1 Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313\u003c\/p\u003e  \u003cp\u003e13.1.1  What is an array?   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313\u003c\/p\u003e  \u003cp\u003e13.1.2  Counting the number of occurrences  . . . . . . . . . . . . . . . . . . . . . . . 314\u003c\/p\u003e  \u003cp\u003e13.2 Offset Indexing  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322\u003c\/p\u003e  \u003cp\u003e13.2.1   Offset indexing to avoid wasteful use of array elements . . . . . . . . . . . . . 322\u003c\/p\u003e  \u003cp\u003e13.2.2   Offset indexing for BMI calculation . . . . . . . . . . . . . . . . . . . . . . . . 323\u003c\/p\u003e  \u003cp\u003e13.2.3   Character occurrence counting   . . . . . . . . . . . . . . . . . . . . . . . . . . 325\u003c\/p\u003e  \u003cp\u003e13.2.4  Negative offset indexing  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330\u003c\/p\u003e  \u003cp\u003e13.3 Primality Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332\u003c\/p\u003e  13.4 Using Multiple Arrays  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336\u003cp\u003e\u003c\/p\u003e   \u003cbr\u003e   \u003cp\u003e \u003c\/p\u003e  \u003cp\u003e13.5 ArrayIndexOutOfBoundsException . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339\u003c\/p\u003e  \u003cp\u003e\u003cb\u003e14  \u003c\/b\u003e\u003cb\u003eClass \u003c\/b\u003eArrays\u003cb\u003e, Resizing Arrays, and Arrays with Capacity                                        347\u003c\/b\u003e\u003c\/p\u003e  \u003cp\u003e14.1 Class Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347\u003c\/p\u003e  \u003cp\u003e14.2   Coordinated Array Modifications with Sustained Length . . . . . . . . . . . . . . . . 351\u003c\/p\u003e  \u003cp\u003e14.2.1  Reversing element order  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354\u003c\/p\u003e  \u003cp\u003e14.2.2  Cyclic shifting   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356\u003c\/p\u003e  \u003cp\u003e14.3   Modifications That Require Resizing  . . . . . . . . . . . . . . . . . . . . . . . . . . . 360\u003c\/p\u003e  \u003cp\u003e14.3.1  Insertion and deletion  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360\u003c\/p\u003e  \u003cp\u003e14.3.2  Merging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367\u003c\/p\u003e  \u003cp\u003e14.4 args - the Argument Array  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368\u003c\/p\u003e  \u003cp\u003e14.5 Searching in an Array   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369\u003c\/p\u003e  \u003cp\u003e14.5.1  Sequential search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369\u003c\/p\u003e  \u003cp\u003e14.5.2  Sequential search in an array with elements in order  . . . . . . . . . . . . . . 370\u003c\/p\u003e  \u003cp\u003e14.5.3  Binary search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371\u003c\/p\u003e  \u003cp\u003e14.6 Arrays with Capacity   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372\u003c\/p\u003e  \u003cp\u003e\u003cb\u003e15  \u003c\/b\u003e\u003cb\u003eMultidimensional Arrays                                                                                            385\u003c\/b\u003e\u003c\/p\u003e  \u003cp\u003e15.1   Two-dimensional Rectangular Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . 385\u003c\/p\u003e  \u003cp\u003e15.1.1  Multi-dimensional arrays   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385\u003c\/p\u003e  \u003cp\u003e15.1.2    Summation of over subsequences  . . . . . . . . . . . . . . . . . . . . . . . . . 386\u003c\/p\u003e  \u003cp\u003e15.2 Matrix multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390\u003c\/p\u003e  \u003cp\u003e15.2.1  Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390\u003c\/p\u003e  15.2.2  Two dimensional rotations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391\u003cp\u003e\u003c\/p\u003e  \u003cp\u003e15.3 Jagged Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395\u003c\/p\u003e  \u003cp\u003e\u003cb\u003eIV   \u003c\/b\u003e\u003cb\u003eObject Classes                                                                                             401\u003c\/b\u003e\u003c\/p\u003e  \u003cp\u003e\u003cb\u003e16  \u003c\/b\u003e\u003cb\u003eClass \u003c\/b\u003eFile                                                           \u003cb\u003e403\u003c\/b\u003e\u003c\/p\u003e  \u003cp\u003e16.1   An Introduction to Object Classes  . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403\u003c\/p\u003e  \u003cp\u003e16.2 File Access   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403\u003c\/p\u003e  \u003cp\u003e16.3 File methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405\u003c\/p\u003e  \u003cp\u003e16.3.1  List of File methods we may use . . . . . . . . . . . . . . . . . . . . . . . . . 405\u003c\/p\u003e  \u003cp\u003e16.3.2  Error handling  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407\u003c\/p\u003e  \u003cp\u003e16.3.3  Listing of File objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417\u003c\/p\u003e  \u003cp\u003e16.4 Scanner of a File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420\u003c\/p\u003e  \u003cp\u003e16.5  Writing to Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427\u003c\/p\u003e  \u003cp\u003e\u003cb\u003e17  \u003c\/b\u003e\u003cb\u003eDesigning Object Classes                                                                                                435\u003c\/b\u003e\u003c\/p\u003e  \u003cp\u003e17.1   Using Object Classes for Packaging Data Elements  . . . . . . . . . . . . . . . . . . . 435\u003c\/p\u003e  \u003cp\u003e17.1.1  The position of a game piece  . . . . . . . . . . . . . . . . . . . . . . . . . . . 435\u003c\/p\u003e  \u003cp\u003e17.1.2    Private instance variables and the toString method  . . . . . . . . . . . . . . 440\u003c\/p\u003e  \u003cp\u003e17.1.3    Using constants in an object class   . . . . . . . . . . . . . . . . . . . . . . . . 442\u003c\/p\u003e  \u003cp\u003e17.1.4  Information hiding  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447\u003c\/p\u003e  \u003cp\u003e17.2 Bank Account . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453\u003c\/p\u003e  \u003cp\u003e17.3 Array with Capacity (as an Object Class)  . . . . . . . . . . . . . . . . . . . . . . . . 461\u003c\/p\u003e   \u003cbr\u003e  \u003cp\u003e\u003cb\u003e18  \u003c\/b\u003e\u003cb\u003eInterfaces, Subclasses, Inheritance, and Polymorphism                                      471\u003c\/b\u003e\u003c\/p\u003e  \u003cp\u003e18.1 Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471\u003c\/p\u003e  18.1.1  Interface as a template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471\u003cp\u003e\u003c\/p\u003e  \u003cp\u003e18.1.2  A simple pizza application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472\u003c\/p\u003e  \u003cp\u003e18.1.3   The “simple” pizza collection class  . . . . . . . . . . . . . . . . . . . . . . . . 473\u003c\/p\u003e  \u003cp\u003e18.1.4   The pizza collection main class  . . . . . . . . . . . . . . . . . . . . . . . . . . 478\u003c\/p\u003e  \u003cp\u003e18.2 Subclasses and Superclasses  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480\u003c\/p\u003e  \u003cp\u003e18.2.1  Extending existing classes and interfaces . . . . . . . . . . . . . . . . . . . . . 480\u003c\/p\u003e  \u003cp\u003e18.2.2  Writing extensions  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482\u003c\/p\u003e  \u003cp\u003e18.3 Polymorphism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490\u003c\/p\u003e  \u003cp\u003e18.4 Interface Comparable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493\u003c\/p\u003e  \u003cp\u003e\u003cb\u003eV   Advanced Concepts                                                                                      499\u003c\/b\u003e\u003c\/p\u003e  \u003cp\u003e\u003cb\u003e19  \u003c\/b\u003e\u003cb\u003eCumulative Algorithms                                                                                              501\u003c\/b\u003e\u003c\/p\u003e  \u003cp\u003e19.1 What is a Cumulative Algorithm?   . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501\u003c\/p\u003e  \u003cp\u003e19.2 Computing Recurrences  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503\u003c\/p\u003e  19.3 Computing the Factorial Function   . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506\u003cp\u003e\u003c\/p\u003e  \u003cp\u003e\u003cb\u003e20  \u003c\/b\u003e\u003cb\u003eRecursive Algorithms                                                                                                 513\u003c\/b\u003e\u003c\/p\u003e  \u003cp\u003e20.1 The Factorial Again  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513\u003c\/p\u003e  \u003cp\u003e20.2 GCD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516\u003c\/p\u003e  \u003cp\u003e20.3 The Tower of Hanoi   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521\u003c\/p\u003e","brand":"Springer Nature Switzerland AG","offers":[{"title":"Default Title","offer_id":52091382759767,"sku":"9783030077853","price":44.99,"currency_code":"GBP","in_stock":true}],"url":"https:\/\/bookcurl.com\/products\/fundamentals-of-java-programming-9783030077853","provider":"Book Curl","version":"1.0","type":"link"}