Sams Teach Yourself Java in 21 Days (Covers Java 11/12), 8th Edition

Book description

In just 21 days, you can acquire the knowledge and skills necessary to develop applications on your computer, web servers, and mobile devices. With this complete tutorial you’ll quickly master the basics and then move on to more advanced features and concepts. Completely updated for Java 11 and 12, this book teaches you about the Java language and how to use it to create applications for any computing environment. By the time you have finished the book, you’ll have well-rounded knowledge of Java and the Java class libraries.

No previous programming experience required. By following the 21 carefully organized lessons in this book, anyone can learn the basics of Java programming.

Learn at your own pace. You can work through each chapter sequentially to make sure you thoroughly understand all the concepts and methodologies, or you can focus on specific lessons to learn the techniques that interest you most.

Test your knowledge. Each chapter ends with a Workshop section filled with questions, answers, and exercises for further study. There are even certification practice questions.

  • Completely revised, updated, and expanded to cover the latest features of Java 11 and 12

  • Learn to develop Java applications using NetBeans–an excellent programming platform

  • Easy-to-understand, practical examples clearly illustrate the fundamentals of Java programming

  • Discover how to quickly develop programs with a graphical user interface

  • Find out about JDBC programming with the Derby database

  • Learn how to use Inner Classes and Lambda Expressions

  • Learn rapid application development with Apache NetBeans

  • Create a game using Java

Table of contents

  1. Cover Page
  2. About This eBook
  3. Title Page
  4. Copyright Page
  5. Figure Credits
  6. Contents at a Glance
  7. Table of Contents
  8. Dedication
  9. About the Author
  10. Acknowledgments
  11. We Want to Hear from You!
  12. Reader Services
  13. Introduction
    1. How This Book Is Organized
    2. Who Should Read This Book
    3. Conventions Used in This Book
  14. Part I: The Java Language
    1. Lesson 1. Getting Started with Java
      1. The Java Language
      2. Object-Oriented Programming
      3. Objects and Classes
      4. Attributes and Behavior
      5. Organizing Classes and Class Behavior
      6. Summary
      7. Q&A
      8. Quiz
      9. Certification Practice
      10. Exercises
    2. Lesson 2. The ABCs of Programming
      1. Statements and Expressions
      2. Variables and Data Types
      3. Comments
      4. Literals
      5. Expressions and Operators
      6. String Arithmetic
      7. Summary
      8. Q&A
      9. Quiz
      10. Certification Practice
      11. Exercises
    3. Lesson 3. Working with Objects
      1. Creating New Objects
      2. Using Class and Instance Variables
      3. Calling Methods
      4. References to Objects
      5. Casting Objects and Primitive Types
      6. Comparing Object Values and Classes
      7. Summary
      8. Q&A
      9. Quiz
      10. Certification Practice
      11. Exercises
    4. Lesson 4. Lists, Logic, and Loops
      1. Arrays
      2. Block Statements
      3. if Conditionals
      4. Switch Conditionals
      5. The Ternary Operator
      6. for Loops
      7. while and do Loops
      8. Breaking Out of Loops
      9. Summary
      10. Q&A
      11. Quiz
      12. Certification Practice
      13. Exercises
    5. Lesson 5. Creating Classes and Methods
      1. Defining Classes
      2. Creating Instance and Class Variables
      3. Creating Methods
      4. Creating Java Applications
      5. Java Applications and Arguments
      6. Creating Methods with the Same Name
      7. Constructors
      8. Overriding Methods
      9. Summary
      10. Q&A
      11. Quiz
      12. Certification Practice
      13. Exercises
    6. Lesson 6. Packages, Interfaces, and Other Class Features
      1. Modifiers
      2. Static Variables and Methods
      3. Final Classes, Methods, and Variables
      4. Abstract Classes and Methods
      5. Packages
      6. Creating Your Own Packages
      7. Interfaces
      8. Creating and Extending Interfaces
      9. Summary
      10. Q&A
      11. Quiz
      12. Certification Practice
      13. Exercises
    7. Lesson 7. Exceptions and Threads
      1. Exceptions
      2. Managing Exceptions
      3. Declaring Methods That Might Throw Exceptions
      4. Creating and Throwing Exceptions
      5. When Not to Use Exceptions
      6. Threads
      7. Summary
      8. Q&A
      9. Quiz
      10. Certification Practice
      11. Exercises
  15. Part II: The Java Class Library
    1. Lesson 8. Data Structures
      1. Moving Beyond Arrays
      2. Java Structures
      3. Generics
      4. Enumerations
      5. Summary
      6. Q&A
      7. Quiz
      8. Certification Practice
      9. Exercises
    2. Lesson 9. Creating a Graphical User Interface
      1. Creating an Application
      2. Working with Components
      3. Lists
      4. The Java Class Library
      5. Summary
      6. Q&A
      7. Quiz
      8. Certification Practice
      9. Exercises
    3. Lesson 10. Building an Interface
      1. Swing Features
      2. Summary
      3. Q&A
      4. Quiz
      5. Certification Practice
      6. Exercises
    4. Lesson 11. Arranging Components on a User Interface
      1. Basic Interface Layout
      2. Mixing Layout Managers
      3. Card Layout
      4. Summary
      5. Q&A
      6. Quiz
      7. Certification Practice
      8. Exercises
    5. Lesson 12. Responding to User Input
      1. Event Listeners
      2. Working with Methods
      3. Summary
      4. Q&A
      5. Quiz
      6. Certification Practice
      7. Exercises
    6. Lesson 13. Creating Java2D Graphics
      1. The Graphics2D Class
      2. Drawing Text
      3. Color
      4. Drawing Lines and Polygons
      5. Summary
      6. Q&A
      7. Quiz
      8. Certification Practice
      9. Exercises
    7. Lesson 14. Developing Swing Applications
      1. Improving Performance with SwingWorker
      2. Grid Bag Layout
      3. Summary
      4. Q&A
      5. Quiz
      6. Certification Practice
      7. Exercises
  16. Part III: Java Programming
    1. Lesson 15. Using Inner Classes and Lambda Expressions
      1. Inner Classes
      2. Lambda Expressions
      3. Variable Type Inference
      4. Summary
      5. Q&A
      6. Quiz
      7. Certification Practice
      8. Exercises
    2. Lesson 16. Working with Input and Output
      1. Introduction to Streams
      2. Byte Streams
      3. Filtering a Stream
      4. Character Streams
      5. Files and Paths
      6. Summary
      7. Q&A
      8. Quiz
      9. Certification Practice
      10. Exercises
    3. Lesson 17. Communicating Over HTTP
      1. Networking in Java
      2. The java.nio Package
      3. Summary
      4. Q&A
      5. Quiz
      6. Certification Practice
      7. Exercises
    4. Lesson 18. Accessing Databases with JDBC and Derby
      1. Java Database Connectivity
      2. Summary
      3. Q&A
      4. Quiz
      5. Certification Practice
      6. Exercises
    5. Lesson 19. Reading and Writing RSS Feeds
      1. Using XML
      2. Designing an XML Dialect
      3. Processing XML with Java
      4. Processing XML with XOM
      5. Summary
      6. Q&A
      7. Quiz
      8. Certification Practice
      9. Exercises
    6. Lesson 20. Making Web Service Requests
      1. Introduction to XML-RPC
      2. Communicating with XML-RPC
      3. Choosing an XML-RPC Implementation
      4. Using an XML-RPC Web Service
      5. Creating an XML-RPC Web Service
      6. Summary
      7. Q&A
      8. Quiz
      9. Certification Practice
      10. Exercises
    7. Lesson 21. Writing a Game with Java
      1. Playing a Game
      2. Summary
      3. Q&A
      4. Quiz
      5. Certification Practice
      6. Exercises
  17. Part IV: Appendixes
    1. Appendix A. Using the NetBeans Integrated Development Environment
      1. Installing NetBeans
      2. Creating a New Project
      3. Creating a New Java Class
      4. Running the Application
      5. Fixing Errors
      6. Expanding and Shrinking a Pane
      7. Exploring NetBeans
    2. Appendix B. Fixing Package Not Visible Errors in NetBeans
      1. Adding Module Info
    3. Appendix C. This Book’s Website
    4. Appendix D. Using the Java Development Kit
      1. Choosing a Java Development Tool
      2. Configuring the Java Development Kit
      3. Using a Text Editor
      4. Creating a Sample Program
    5. Appendix E. Programming with the Java Development Kit
      1. Overview of the JDK
      2. java, the Java Virtual Machine
      3. The javac Compiler
      4. The javadoc Documentation Tool
      5. The jar Java File Archival Tool
      6. The jdb Debugger
      7. Using System Properties
      8. Writing Java Statements in a Shell
  18. Index
  19. Code Snippets

Product information

  • Title: Sams Teach Yourself Java in 21 Days (Covers Java 11/12), 8th Edition
  • Author(s): Rogers Cadenhead
  • Release date: January 2020
  • Publisher(s): Sams
  • ISBN: 9780134663661