Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17
Book information
Description
Learn the fundamentals of the Java 17 LTS or Java Standard Edition version 17 Long Term Support release, including basic programming concepts and the object-oriented fundamentals necessary at all levels of Java development. Authors Kishori Sharan and Adam L. Davis walk you through writing your first Java program step-by-step. Armed with that practical experience, you'll be ready to learn the core of the Java language. Beginning Java 17 Fundamentals provides over 90 diagrams and 240 complete programs to help you learn the topics faster. While this book teaches you the basics, it also has been revised to include the latest from Java 17 including the following: value types (records), immutable objects with an efficient memory layout; local variable type inference (var); pattern matching, a mechanism for testing and deconstructing values; sealed types, a mechanism for declaring all possible subclasses of a class; multiline text values; and switch expressions. The book continues with a series of foundation topics, including using data types, working with operators, and writing statements in Java. These basics lead onto the heart of the Java language: object-oriented programming. By learning topics such as classes, objects, interfaces, and inheritance you'll have a good understanding of Java's object-oriented model. The final collection of topics takes what you've learned and turns you into a real Java programmer. You'll see how to take the power of object-oriented programming and write programs that can handle errors and exceptions, process strings and dates, format data, and work with arrays to manipulate data. What You Will Learn Write your first Java programs with emphasis on learning object-oriented programmingHow to work with switch expressions, value types (records), local variable type inference, pattern matching switch and more from Java 17Handle exceptions, assertions, strings and dates, and object formattingLearn about how to define and use modulesDive in depth into classes, interfaces, and inheritance in JavaUse regular expressionsTake advantage of the JShell REPL tool Who This Book Is For Those who are new to Java programming, who may have some or even no prior programming experience. Table of Contents About the Authors About the Technical Reviewer Acknowledgments Introduction Chapter 1: Programming Concepts What Is Programming? Components of a Programming Language Programming Paradigms Imperative Paradigm Procedural Paradigm Declarative Paradigm Functional Paradigm Logic Paradigm Object-Oriented Paradigm What Is Java? The Object-Oriented Paradigm and Java Abstraction Abstraction for Hiding Complexities Data Abstraction Encapsulation and Information Hiding Inheritance Polymorphism Overloading Polymorphism Coercion Polymorphism Inclusion Polymorphism Parametric Polymorphism Summary Chapter 2: Setting Up the Environment System Requirements Installing JDK 17 The JDK Directory Structure Verifying the JDK Installation Starting the JShell Tool Installing NetBeans 12 Configuring NetBeans Summary Chapter 3: Writing Java Programs The Goal Statement Using the JShell Tool What Is a Java Program? Writing the Source Code Writing Comments Declaring a Module Declaring Types Package Declaration Import Declarations Class Declaration Types Have Two Names Compiling the Source Code Packaging the Compiled Code Running a Java Program Playing with Module Options Listing Observable Modules Limiting the Observable Modules Describing a Module Printing Module Resolution Details Dry-Running Your Program Enhancing a Module Descriptor Running Java Programs in Legacy Mode Duplicate Modules on a Module Path Syntax for Command-Line Options Writing Java Programs Using the NetBeans IDE Creating a Java Project Creating Modular JARs in NetBeans NetBeans Project Directory Structure Adding Classes to a Module Customizing NetBeans Project Properties Opening an Existing NetBeans Project Behind the Scenes Summary Chapter 4: Data Types What Is a Data Type What Is an Identifier? Keywords Data Types in Java Local Variable Type Inference Primitive Data Types in Java Integral Data Types The int Data Type The long Data Type The byte Data Type The short Data Type The char Data Type Character Literals in Single Quotes Character Escape Sequence Unicode Character Escape Sequence Octal Character Escape Sequence The boolean Data Type Floating-Point Data Types The float Data Type The double Data Type Underscores in Numeric Literals Java Compiler and Unicode Escape Sequence A Short Break Binary Representation of Integers Diminished Radix Complement Radix Complement Binary Representation of Floating-Point Numbers 32-Bit Single-Precision Floating-Point Format Sign Exponent Significand Special Floating-Point Numbers Signed Zeros Signed Infinities NaN Denormals Rounding Modes Rounding Toward Zero Rounding Toward Positive Infinity Rounding Toward Negative Infinity Rounding Toward Nearest IEEE Floating-Point Exceptions Division by Zero Exception Invalid Operation Exception Overflow Exception Underflow Exception Inexact Exception Java and IEEE Floating-Point Standards Little-Endian and Big-Endian Summary Chapter 5: Operators What Is an Operator? Assignment Operator Declaration, Initialization, and Assignment Arithmetic Operators Addition Operator (+) Subtraction Operator (-) Multiplication Operator (*) Division Operator (/) Modulus Operator (%) Rule #1 Rule #2 Rule #1 Rule #2 Rule #3 Rule #4 Rule #5 Unary Plus Operator (+) Unary Minus Operator (-) Compound Arithmetic Assignment Operators Increment (++) and Decrement (--) Operators String Concatenation Operator (+) Relational Operators Equality Operator (==) Rule #1 Rule #2 Rule #3 Inequality Operator (!=) Greater Than Operator (>) Greater Than or Equal to Operator (>=) Less Than Operator (
Similar books
Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17
2021 · PDF
Modern Programming Made Easy: Using Java, Scala, Groovy, and JavaScript, 2nd Edition
2020 · PDF
Modern Programming Made Easy: Using Java, Scala, Groovy, and JavaScript, 2nd Edition
2020 · EPUB
Learn JavaFX 17 - Building User Experience and Interfaces with Java
2022 · PDF
Learn JavaFX 17: Building User Experience and Interfaces with Java
2022 · PDF
Learn JavaFX 17: Building User Experience and Interfaces with Java
2022 · EPUB
More Java 17: An In-Depth Exploration of the Java Language and Its Features
2021 · EPUB
More Java 17: An In-Depth Exploration of the Java Language and Its Features
2021 · PDF