Book description
Beginning Java 8 Fundamentals provides a comprehensive approach to learning the Java programming language, especially the object-oriented fundamentals necessary at all levels of Java development.
Author Kishori Sharan provides over 90 diagrams and 240 complete programs to help beginners and intermediate level programmers learn the topics faster. Starting with basic programming concepts, the author walks 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.
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.
Table of contents
- Cover
- Title
- Copyright
- Dedication
- Contents at a Glance
- Contents
- Foreword
- About the Author
- About the Technical Reviewer
- Acknowledgments
- Introduction
- Chapter 1: Programming Concepts
- Chapter 2: Writing Java Programs
-
Chapter 3: Data Types
- What Is a Data Type?
- What Is an Identifier?
- Data Types in Java
- Primitive Data Types in Java
- Underscores in Numeric Literals
- Java Compiler and Unicode Escape Sequence
- A Short Break
- Binary Representation of Integers
- Binary Representation of Floating-Point Numbers
- Special Floating-Point Numbers
- Rounding Modes
- IEEE Floating-Point Exceptions
- Java and IEEE Floating-Point Standards
- Little-Endian and Big-Endian
- Summary
- Chapter 4: Operators
- Chapter 5: Statements
-
Chapter 6: Classes and Objects
- What Is a Class?
- Declaring a Class
- Declaring Fields in a Class
- Creating Instances of a Class
- The null Reference Type
- Using Dot Notation to Access Fields of a Class
- Default Initialization of Fields
- Access Level Modifiers for a Class
- Import Declarations
- Static Import Declarations
- Declaring Methods of a Class
- Local Variables
- Instance Method and Class Method
- Invoking a Method
- The Special main() Method
- What Is this?
- Access Levels for Class Members
- Access Level—A Case Study
- Parameter Passing Mechanisms
- Parameter Passing Mechanisms in Java
- Constructors
- Instance Initialization Block
- static Initialization Block
- The final Keyword
- What is a varargs Method?
- Generic Classes
- Summary
- Chapter 7: The Object and Objects Classes
- Chapter 8: Wrapper Classes
-
Chapter 9: Exception Handling
- What Is an Exception?
- An Exception Is an Object
- Using a try-catch Block
- Transfer of Control
- Exception Class Hierarchy
- Arranging Multiple catch Blocks
- Checked and Unchecked Exceptions
- Checked Exception - Catch or Declare
- Checked Exceptions and Initializers
- Throwing an Exception
- Creating an Exception Class
- The finally Block
- Rethrowing an Exception
- Analysis of Rethrown Exceptions
- Throwing too Many Exceptions
- Accessing the Stack of a Thread
- The try-with-resources Block
- A Multi-Catch Block
- Summary
- Chapter 10: Assertions
-
Chapter 11: Strings
- What is a String?
- String Literals
- Escape Sequence Characters in String Literals
- Unicode Escapes in String Literals
- What is a CharSequence?
- Creating String Objects
- Length of a String
- String Literals Are String Objects
- String Objects Are Immutable
- Comparing Two Strings
- String Pool
- String Operations
- Splitting and Joining Strings
- Strings in a switch Statement
- Testing a String for Palindrome
- StringBuilder and StringBuffer
- String Concatenation Operator (+)
- Language-Sensitive String Comparison
- Summary
-
Chapter 12: Dates and Times
- The Date-Time API
- Design Principles
- A Quick Example
- Evolution of Timekeeping
- Time Zones and Daylight Saving Time
- Calendar Systems
- ISO-8601 Standards for Datetime
- Exploring the New Date-Time API
- Instants and Durations
- Human-Scale Time
- Same Instant, Different Times
- Clocks
- Periods
- Period Between Two Dates and Times
- Partials
- Adjusting Dates
- Querying Datetime Objects
- Non-ISO Calendar Systems
- Formatting Dates and Times
- Parsing Dates and Times
- Legacy Datetime Classes
- Interoperability with Legacy Datetime Classes
- Summary
- Chapter 13: Formatting Data
-
Chapter 14: Regular Expressions
- What Is a Regular Expression?
- Metacharacters
- Character Classes
- More Powers to Regular Expressions
- Beware of Backslashes
- Quantifiers in Regular Expressions
- Matching Boundaries
- Groups and Back Referencing
- Using Named Groups
- Resetting the Matcher
- Final Words on E-mail Validations
- Find-and-Replace Using Regular Expressions
- Summary
-
Chapter 15: Arrays
- What Is an Array?
- Arrays Are Objects
- Accessing Array Elements
- Length of an Array
- Initializing Array Elements
- Beware of Reference Type Arrays
- Explicit Array Initialization
- Limitations of Using Arrays
- Variable-Length Arrays
- Passing an Array as a Parameter
- Command-Line Arguments
- Multi-Dimensional Arrays
- Enhanced for Loop for Arrays
- Array Declaration Syntax
- Runtime Array Bounds Checks
- What Is the Class of an Array Object
- Array Assignment Compatibility
- Converting an ArrayList/Vector to an Array
- Summary
-
Chapter 16: Inheritance
- What is Inheritance?
- Object Class is the Default Superclass
- Inheritance and Hierarchical Relationship
- What Is Inherited by a Subclass?
- Upcasting and Downcasting
- The instanceof Operator
- Binding
- Method Overriding
- Accessing Overridden Method
- Method Overloading
- Inheritance and Constructors
- Method Hiding
- Field Hiding
- Disabling Inheritance
- Abstract Classes and Methods
- Method Overriding and Generic Method Signatures
- Typo Danger in Method Overriding
- Is-a, has-a, and part-of Relationships
- No Multiple Inheritance of Classes
- Summary
-
Chapter 17: Interfaces
- What Is an Interface?
- Declaring an Interface
- Declaring Interface Members
- An Interface Defines a New Type
- Implementing an Interface
- Implementing Interface Methods
- Implementing Multiple Interfaces
- Partially Implementing an Interface
- The Supertype-Subtype Relationship
- Interface Inheritance
- The Superinterface-Subinterface Relationship
- Inheriting Conflicting Implementations
- The instanceof Operator
- Marker Interfaces
- Functional Interfaces
- Comparing Objects
- Polymorphism—One Object, Many Views
- Dynamic Binding and Interfaces
- Summary
-
Chapter 18: Enum Types
- What Is an Enum Type?
- Superclass of an Enum Type
- Using Enum Types in switch Statements
- Associating Data and Methods to Enum Constants
- Associating a Body to an Enum Constant
- Comparing Two Enum Constants
- Nested Enum Types
- Implementing an Interface to an Enum Type
- Reverse Lookup for Enum Constants
- Range of Enum Constants
- Summary
- Appendix A: Character Encodings
-
Appendix B: Documentation Comments
- Writing Documentation Comments
-
List of Block and Inline Tags
- @author <author-name(s)>
- @deprecated <explanation-text>
- @exception <class-name> <description>
- @param <parameter-name> <description>
- @return <description>
- @see <reference>
- @serial <field-description or include/exclude>
- @serialData <data-description>
- @serialField <field-name> <field-type> <field-description>
- @since <description>
- @throws <class-name> <description>
- @version <version-text>
- {@code <text>}
- {@docRoot}
- {@inheritDoc}
- {@link <package.class#member> <label>}
- {@linkplain <package.class#member> <label>}
- {@literal <text>}
- {@value <package.class#field>}
- Documenting Packages
- Overview Documentation
- Including Unprocessed Files in Documentation
- Skipping Source Files Processing
- An Example of Documentation Comments
- Running the javadoc Tool
- Generated Documentation Files
- Viewing Generated HTML Documentation
- Summary
- Appendix C: Compact Profiles
- Index
Product information
- Title: Beginning Java 8 Fundamentals: Language Syntax, Arrays, Data Types, Objects, and Regular Expressions
- Author(s):
- Release date: June 2014
- Publisher(s): Apress
- ISBN: 9781430266532
You might also like
book
Java XML and JSON: Document Processing for Java SE
Use this guide to master the XML metalanguage and JSON data format along with significant Java …
book
Programming Basics: Getting Started with Java, C#, and Python
Explore the basics of the three most popular programming languages: C#, Java, and Python and see …
book
Beginning Java 8 Language Features: Lambda Expressions, Inner Classes, Th reads, I/O, Collections,and Streams
Beginning Java 8 Language Features covers essential and advanced features of the Java programming language such …
book
Java Programming for Beginners
Java Programming for Beginners is an introduction to Java programming, taking you through the Java syntax …