<p>Making 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, <i>Fundamentals of Java Programming </i>eschews second-semester cont
Fundamentals of Java programming
✍ Scribed by Ogihara, Mitsunori
- Publisher
- Springer
- Year
- 2018
- Tongue
- English
- Leaves
- 514
- Category
- Library
No coin nor oath required. For personal study only.
✦ Synopsis
Making 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, Fundamentals of Java Programming eschews second-semester content to concentrate on over 180 code examples and 250 exercises.Key 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.Teaching resources include solutions to the exercises, as well as digital lecture slides.
✦ Table of Contents
Preface......Page 6
Contents......Page 7
List of Figures......Page 12
List of Tables......Page 14
Part I Programming Basics......Page 15
1.1.1 The Java Virtual Machine (JVM)......Page 16
1.1.2 Changing Folders in a Command Line Interface......Page 17
1.1.3 Source Codes, Bytecodes, and Compilation......Page 19
1.2 The First Program, Hello, World!''......Page 20<br> 1.2.1 Methods and Their Declarations......Page 22<br> 1.2.2 System.out.println and System.out.print......Page 23<br> 1.2.4 Commenting......Page 24<br> 1.2.5 Errors......Page 26<br> 1.3.1 System.out.println and System.out.print (Reprise)......Page 28<br> 1.3.2 Printing Multiple-Line Texts on the Screen......Page 29<br> 1.3.3 Escaping Characters......Page 31<br> 1.3.4 Printing Shapes......Page 33<br> Summary......Page 36<br> Exercises......Page 37<br> 2.1.1 Data and Their Taxonomy......Page 41<br> 2.1.2 Number Literals......Page 42<br> 2.1.3 Variable Declarations......Page 44<br> 2.1.4 Assigning Values to Variables......Page 45<br> 2.2 The Primitive Data Types......Page 47<br> 2.3.1 Quarterbacks Program (Reprise)......Page 49<br> 2.3.2.1 Number Operations......Page 51<br> 2.3.2.2 Evaluation of Formulas......Page 53<br> 2.3.2.3 Mixing Different Number Types in a Formula......Page 57<br> 2.3.3 Computing the Body-Mass Index......Page 58<br> 2.3.4 Sum of Integers from 1 to 100 à la Gauss......Page 60<br> 2.3.4.1 Truncation of Real Numbers......Page 61<br> 2.3.5 Simplified Expressions......Page 63<br> 2.4.1 The String Data Type......Page 68<br> 2.4.2.1 Concatenating Two String Data......Page 71<br> 2.4.2.2 Concatenating String Data with Other Types of Data......Page 73<br> Summary......Page 74<br> Exercises......Page 75<br> 3.1.1 Importing Source Codes......Page 80<br> 3.1.2 The Instantiation of a Scanner Object......Page 81<br> 3.2 Reading Data with a Scanner Object......Page 82<br> 3.3 Reading Input from the Keyboard......Page 88<br> Summary......Page 91<br> Exercises......Page 92<br> 4.1.1 Printing Rectangles......Page 97<br> 4.1.2 Printing Quadrangles......Page 102<br> 4.1.3Old MacDonald Had a Farm''......Page 105
4.1.4 A General Strategy for Procedural Decomposition......Page 111
4.2 Using Multiple Program Files......Page 113
Exercises......Page 115
5.1.1 Methods That Work with Parameters......Page 119
5.1.2 Method Overloading......Page 125
5.2 Receiving a Value from a Method......Page 129
5.3.1 Mathematical Functions in Java......Page 134
5.3.2 Mortgage Calculation......Page 141
Summary......Page 146
Exercises......Page 147
6.1 Condition and Its Evaluation......Page 152
6.2.1 If......Page 158
6.2.2 Else......Page 165
6.2.3 If-Else Inside If/Else......Page 167
6.2.4 Truncation of Conditional Evaluations......Page 171
Summary......Page 172
Exercises......Page 173
Part II Loops......Page 179
7.1 Using For-Loops for Repetition......Page 180
7.2.1 Simple Iteration......Page 187
7.2.2 Iteration with an Auxiliary Variable......Page 193
7.3 Double For-Loops......Page 194
7.4 Computing the Maximum and Minimum in a Series of Numbers......Page 200
7.5.1 For-Loops with Skipped Execution......Page 202
7.5.2 The Statements continue and break......Page 206
7.6 Computing the Fibonacci Sequence......Page 208
Exercises......Page 209
8.2 Formatted Printing of String Data......Page 217
8.3 Formatted Printing of Integers......Page 220
8.4 Formatted Printing of Floating Point Numbers......Page 222
8.5 Printing the Fibonacci Sequence (Reprise)......Page 224
Exercises......Page 227
9.1 Methods for Obtaining Information from String Data......Page 231
9.2.1 The Equality Test and the Comparison in Dictionary Order......Page 234
9.2.2 The Prefix and Suffix Tests......Page 236
9.3 Methods for Searching for a Pattern in a String Data......Page 237
9.4 Methods for Creating New String Data from Another......Page 240
9.5 Class StringBuilder......Page 243
Exercises......Page 245
10.1 The Syntax of Switch Statements......Page 251
10.2 Using a char Data in a Switch-Statement......Page 258
10.3 Using a String Data in a Switch Statement......Page 263
Summary......Page 264
Exercises......Page 265
11.1.1 The Syntax of While-Loops......Page 268
11.1.2 Summing Input Numbers Until the Total Reaches a Goal......Page 270
11.1.3 Integer Overflow......Page 271
11.1.4 Vending Machines......Page 273
11.1.5 The Collatz Conjecture......Page 275
11.1.6 Covnerting Decimal Numbers to Binary Numbers......Page 278
11.2.1 The Syntax of Do-While Loops......Page 281
11.2.2 Waiting for Godot''......Page 282<br> 11.3 CTRL-D......Page 283<br> 11.4 Approximating the Square Root of a Real Number......Page 288<br> Exercises......Page 292<br>Part III Arrays and Objects......Page 298<br> 12.1.1 The Structure of an Array......Page 299<br> 12.1.2.1 Computing Distributions......Page 300<br> 12.1.2.2 Simulating the Action of Throwing Two Dice......Page 304<br> 12.1.3 ArrayIndexOutOfBoundsException......Page 307<br> 12.2.1 The Concept of Relative Indexing......Page 309<br> 12.2.2 Calculating the BMI for a Range of Weight Values......Page 310<br> 12.2.3 Counting the Occurrences of Characters......Page 311<br> 12.3 Arrays of boolean Data......Page 314<br> 12.4 Using Multiple Arrays......Page 318<br> 12.5 String Methods That Return an Array......Page 321<br> Exercises......Page 322<br> 13.1 The Class Arrays......Page 328<br> 13.2 Reordering Elements in an Array......Page 332<br> 13.2.2 Cyclic Shifting......Page 335<br> 13.3.1 Insertion and Deletion......Page 339<br> 13.3.2 Adjoining Two Arrays......Page 344<br> 13.4 args......Page 345<br> 13.5.1 Sequential Search......Page 346<br> 13.5.2 Binary Search......Page 347<br> 13.6 Arrays with Capacity and Size......Page 348<br> Summary......Page 354<br> Exercises......Page 355<br> 14.1.1 Defining Multi-Dimensional Arrays......Page 360<br> 14.1.2 Summing the Elements in Subsequences......Page 361<br> 14.2 Jagged Arrays......Page 364<br> Exercises......Page 367<br> 15.1.1 The File Path and the Instantiation of a File Object......Page 370<br> 15.1.2 File Methods......Page 371<br> 15.1.3.2Throwing'' a Run-Time Error......Page 373
15.1.3.3 Catching'' a Run-Time Error......Page 374<br> 15.1.3.4 A Demonstration of Try-Catch......Page 375<br> 15.1.4 File Listing......Page 379<br> 15.2 Using Scanner Objects to Read from Files......Page 381<br> 15.3 Using PrintStream to Write to Files......Page 387<br> Summary......Page 389<br> Exercises......Page 390<br> 16.1.1 The Position of a Game Piece......Page 394<br> 16.1.2 Private Instance Variables and the toString Method......Page 398<br> 16.1.3 Using Constants in an Object Class......Page 401<br> 16.1.4 Information Hiding......Page 405<br> 16.2 An Object Class Representing a Bank Account......Page 411<br> 16.3 Array with Capacity and Size (Reprise)......Page 418<br> Exercises......Page 422<br>Part IV Advanced Concepts......Page 427<br> 17.1.2.1 A Simple Pizza Class......Page 428<br> 17.1.2.2 Using an Interface as a Data Type......Page 430<br> 17.1.2.3 Instance Variables and Constructors......Page 431<br> 17.1.2.5 Writing Data......Page 432<br> 17.1.2.7 Removing a Pizza from the List......Page 433<br> 17.1.2.9 The Pizza Collection Main Class......Page 434<br> 17.2.1 Extending Existing Classes and Interfaces......Page 436<br> 17.2.2.1 Writing a Subclass......Page 438<br> 17.2.2.2 A Class for a Collection of PizzaComplex Data......Page 441<br> 17.3 Polymorphism......Page 446<br> 17.4 Boxed Data Types......Page 447<br> 17.5 Interface Comparable......Page 448<br> Summary......Page 453<br> Exercises......Page 454<br> 18.1.2 The Class for Merchandise Item......Page 457<br> 18.1.3 The Comparator Class......Page 458<br> 18.1.4.1 ArrayList......Page 459<br> 18.1.4.2 The Instance Variables, theGetters'', and the ``Setters''......Page 460
18.1.4.4 The Sorting Methods......Page 462
18.1.5.1 The Method for Printing Prompt......Page 463
18.1.5.3 Adding and Removing......Page 464
18.1.5.4 Viewing and Sorting......Page 465
18.1.5.5 Making Changes......Page 466
18.1.5.6 File Read/Write......Page 467
18.2 The Dynamic Maintenance of the Largest K Values......Page 470
18.3.1 The Framework......Page 473
18.3.2 Some Classes from the Framework......Page 475
18.3.3 A Demonstration......Page 477
Exercises......Page 481
19.1.1 The Definition of Online Algorithms......Page 485
19.1.2 Computing Recurrences......Page 486
19.1.3 Computing the Factorial Function......Page 489
19.2.1 Computing the Factorial Function Recursively......Page 492
19.2.2 The Greatest Common Divisor of Two Integers......Page 497
19.2.3.2 Our Solution......Page 500
19.2.3.3 Will the World End Soon?......Page 503
Exercises......Page 504
Index......Page 506
📜 SIMILAR VOLUMES
Making 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, Fundamentals of Java Programming eschews second-semester content to con
<span>Making 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, </span><span>Fundamentals of Java Programming </span><span>eschew
Курс по программированию. — Владивосток: ВГУЭС, 2013.<div class="bb-sep"></div>Материалы представлены на английском языке.<div class="bb-sep"></div>Аннотация: This course engages students with little or no programming experience to create Java programs. Participants are introduced to object-oriented