Prix bas
CHF68.80
Habituellement expédié sous 2 à 4 jours ouvrés.
This is the up-to-date, practical guide to Java you've been looking for! Whether you're a beginner, you're switching to Java from another language, or you're just looking to brush up on your Java skills, this is the only book you need. You'll get a thorough grounding in the basics of the Java language, including classes, objects, arrays, strings, and exceptions. You'll also learn about more advanced topics: threads, algorithms, XML, JUnit testing, and much more. This book belongs on every Java programmer's shelf! Highlights: Classes and objects Arrays Exception handling Object-oriented programming Characters and strings Generics Class library Concurrent programming Data structures Lambda expressions JUnit testing JDK tools
Work with expressions, statements, classes, objects, and much more
Contenu
... Preface ... 31
... Target Group ... 31
... What This Book Is Not ... 31
... My Life and Java, Or Why a Java Book? ... 32
... Software and Versions ... 33
... Which Java Version to Use ... 33
... Using This Book to Learn ... 33
... Personal Learning Strategies ... 34
... Focusing on the Essentials ... 35
... Special Sections ... 35
... Tasks ... 36
... Structure of This Book ... 36
... Conventions ... 38
... Program Listings ... 40
... Application Programming Interface Documentation in This Book ... 40
... Executable Programs ... 41
... Acknowledgments ... 41
... Resources for This Book ... 42
... Feedback ... 42
1 ... Introduction ... 43
1.1 ... Historical Background ... 43
1.2 ... On the Popularity of Java: The Key Features ... 45
1.3 ... Java versus Other Languages* ... 56
1.4 ... Further Development and Losses ... 59
1.5 ... Java Platforms ... 62
1.6 ... Java Platform, Standard Edition, Implementations ... 67
1.7 ... Installing the Java Development Kit ... 69
1.8 ... Compiling and Testing the First Program ... 71
1.9 ... Development Environments ... 75
1.10 ... Further Reading ... 81
2 ... Imperative Language Concepts ... 83
2.1 ... Elements of the Java Programming Language ... 83
2.2 ... From Classes to Statements ... 91
2.3 ... Data Types, Typing, Variables, and Assignments ... 102
2.4 ... Expressions, Operands, and Operators ... 119
2.5 ... Conditional Statements or Case Distinctions ... 142
2.6 ... Always the Same with Loops ... 160
2.7 ... Methods of a Class ... 177
2.8 ... Further Reading ... 200
3 ... Classes and Objects ... 201
3.1 ... Object-Oriented Programming ... 201
3.2 ... Members of a Class ... 203
3.3 ... Natural Modeling Using Unified Modeling Language* ... 204
3.4 ... Creating New Objects ... 206
3.5 ... ZZZZZnake ... 218
3.6 ... Tying Packages, Imports, and Compilation Units ... 220
3.7 ... Using References, Diversity, Identity, and Equality ... 228
3.8 ... Further Reading ... 239
4 ... Arrays and Their Areas of Use ... 241
4.1 ... Simple Field Work ... 241
4.2 ... The Extended for Loop ... 252
4.3 ... A Method with a Variable Number of Arguments ... 256
4.4 ... Multidimensional Arrays* ... 259
4.5 ... Library Support for Arrays ... 264
4.6 ... Using the Arrays Class for Comparing, Filling, Searching, and Sorting ... 267
4.7 ... The Entry Point for the Runtime System: main(...) ... 281
4.8 ... Further Reading ... 285
5 ... Handling Characters and Strings ... 287
5.1 ... From ASCII via ISO-8859-1 to Unicode ... 287
5.2 ... Data Types for Characters and Strings ... 295
5.3 ... The Character Class ... 296
5.4 ... Strings ... 301
5.5 ... The String Class and Its Methods ... 303
5.6 ... Mutable Strings with StringBuilder and StringBuffer ... 333
5.7 ... CharSequence as Base Type ... 342
5.8 ... Converting Primitives and Strings ... 345
5.9 ... Concatenating Strings ... 353
5.10 ... Decomposing Strings ... 355
5.11 ... Formatting Outputs ... 360
5.12 ... Further Reading ... 367
6 ... Writing Custom Classes ... 369
6.1 ... Declaring Custom Classes with Members ... 369
6.2 ... Privacy and Visibility ... 380
6.3 ... One for All: Static Methods and Class Variables ... 390
6.4 ... Constants and Enumerations ... 397
6.5 ... Creating and Destroying Objects ... 405
6.6 ... Class and Object Initialization* ... 418
6.7 ... Conclusion ... 426
7 ... Object-Oriented Relationship ... 427
7.1 ... Associations between Objects ... 427
7.2 ... Inheritance ... 436
7.3 ... Types in Hierarchies ... 447
7.4 ... Overriding Methods ... 457
7.5 ... Testing Dynamic Bindings ... 463
7.6 ... Final Classes and Final Methods ... 466
7.7 ... Abstract Classes and Abstract Methods ... 468
7.8 ... Further Information on Overriding and Dynamic Binding ... 476
7.9 ... A Programming Task ... 482
8 ... Interfaces, Enumerations, Sealed Classes, Records ... 483
8.1 ... Interfaces ... 483
8.2 ... Enumeration Types ... 513
8.3 ... Sealed Classes and Interfaces ... 523
8.4 ... Records ... 529
9 ... There Must Be Exceptions ... 539
9.1 ... Fencing In Problem Areas ... 539
9.2 ... Redirecting Exceptions and throws at the Head of Methods/Constructors ... 549
9.3 ... The Class Hierarchy of Exceptions ... 550
9.4 ... Final Handling Using finally ... 558
9.5 ... Triggering Custom Exceptions ... 564
9.6 ... try with Resources (Automatic Resource Management) ... 579
9.7 ... Special Features of Exception Handling* ... 588
9.8 ... Hard Errors: Error* ... 593
9.9 ... Assertions* ... 594
9.10 ... Conclusion ... 597
10 ... Nested Types ... 599
10.1 ... Nested Classes, Interfaces, and Enumerations ... 599
10.2 ... Static Nested Types ... 601
10.3 ... Non-Static Nested Types ... 603
10.4 ... Local Classes ... 605
10.5 ... Anonymous Inner Classes ... 607
10.6 ... Nests ... 613
10.7 ... Conclusion ... 614
11 ... Special Types of Java SE ... 615
11.1 ... Object Is the Mother of All Classes ... 616
11.2 ... Weak References and Cleaners ... 638
11.3 ... The java.util.Objects Utility Class ... 639
11.4 ... Comparing Objects and Establishing Order ... 643
11.5 ... Wrapper Classes and Autoboxing ... 651
11.6 ... Iterator, Iterable* ... 670
11.7 ... Annotations in Java Platform, Standard Edition ... 677
11.8 ... Further Reading ... 682
12 ... Generics ... 683
12.1 ... Introduction to Java Generics ... 683
12.2 ... Implementing Generics, Type Erasure, and Raw Types ... 699
12.3 ... Restricting Types via Bounds ... 706
12.4 ... Type Parameters in the throws Clause* ... 710
12.5 ... Inheritance and Invariance with Generics ... 713
12.6 ... Consequences of Type Erasure: Type Tokens, Arrays* ... 725
12.7 ... Further Reading ... 729
13 ... Lambda Expressions and Functional Programming ... 731
13.1 ... Functional Interfaces and Lambda Expressions ... 731
13.2 ... Method References ... 755
13.3 ... Constructor References ... 759
13.4 ... Functional Programming ... 762
13.5 ... Functional Interfaces from the java.util.function Package ... 770
13.6 ... Optional Is Not a Non-Starter ... 784
13.7 ... What Is So Functional Now? ... 795
13.8 ... Further Reading ... 797
14 ... Architecture, Design, and Applied Object Orientation ... 799
14.1 ... SOLID Modeling ... 799
14…