Java in 24 hours, sams teach yourself (covering java 9)

1.1K 264 0
Java in 24 hours, sams teach yourself (covering java 9)

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Sams Teach Yourself Java in 24 Hours, Eighth Edition Copyright © 2018 by Pearson Education, Inc All rights reserved No part of this book shall be reproduced, stored in a retrieval system, or transmitted by any means, electronic, mechanical, photocopying, recording, or otherwise, without written permission from the publisher No patent liability is assumed with respect to the use of the information contained herein Although every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions Nor is any liability assumed for damages resulting from the use of the information contained herein ISBN-13: 978-0-672-33794-9 ISBN-10: 0-672-33794-0 Library of Congress Control Number: 2017946911 Printed in the United States of America 1  17 Trademarks All terms mentioned in this book that are known to be trademarks or service marks have been appropriately capitalized Pearson cannot attest to the accuracy of this information Use of a term in this book should not be regarded as affecting the validity of any trademark or service mark Warning and Disclaimer Every effort has been made to make this book as complete and as accurate as possible, but no warranty or fitness is implied The information provided is on an “as is” basis The author and the publisher shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this book Special Sales For information about buying this title in bulk quantities, or for special sales opportunities (which may include electronic versions; custom cover designs; and content particular to your business, training goals, marketing focus, or branding interests), please contact our corporate sales department at corpsales@pearsoned.com or (800) 382-3419 For government sales inquiries, please contact governmentsales@pearsoned.com For questions about sales outside the U.S., please contact intlcs@pearsoned.com Editor Mark Taber Senior Project Editor Lori Lyons Project Manager Dhayanidhi Karunanidhi Copy Editor Abigail Manheim Bass Technical Editor Boris Minkin Table of Contents Introduction PART I: Getting Started HOUR 1: Becoming a Programmer Choosing a Language Telling the Computer What to Do How Programs Work When Programs Don’t Work Choosing a Java Programming Tool Installing a Java Development Tool HOUR 2: Writing Your First Program What You Need to Write Programs Creating the Saluton Program Beginning the Program The class Statement What the main Statement Does Those Squiggly Bracket Marks Storing Information in a Variable Displaying the Contents of a Variable Saving the Finished Product Compiling the Program into a Class File Fixing Errors Running a Java Program HOUR 3: Vacationing in Java First Stop: Oracle A Brief History of Java Going to School with Java Lunch at Food Network Watching the Skies at NASA Getting Down to Business Stopping by SourceForge for Directions HOUR 4: Understanding How Java Programs Work Creating an Application Sending Arguments to Applications The Java Class Library Trying Java Statements in JShell PART II: Learning the Basics of Programming HOUR 5: Storing and Changing Information in a Program Statements and Expressions Assigning Variable Types Integers and Floating-Point Numbers Characters and Strings Other Numeric Variable Types The boolean Variable Type Naming Your Variables Storing Information in a Variable All About Operators Incrementing and Decrementing a Variable Operator Precedence Using Expressions HOUR 6: Using Strings to Communicate Storing Text in Strings Displaying Strings in Programs Using Special Characters in Strings Pasting Strings Together Using Other Variables with Strings Advanced String Handling Comparing Two Strings Determining the Length of a String Copying a String with a New Case Looking for a String Presenting Credits HOUR 7: Using Conditional Tests to Make Decisions if Statements Less-Than and Greater-Than Comparisons Equal and Not Equal Comparisons Organizing a Program with Block Statements if-else Statements switch Statements The Ternary Operator Watching the Clock HOUR 8: Repeating an Action with Loops for Loops while Loops do-while Loops Exiting a Loop Naming a Loop Complex for Loops Testing Your Computer Speed PART III: Working with Information in New Ways HOUR 9: Storing Information with Arrays Creating Arrays Using Arrays Multidimensional Arrays Sorting an Array Counting Characters in Strings HOUR 10: Creating Your First Object How Object-Oriented Programming Works Objects in Action What Objects Are Understanding Inheritance Building an Inheritance Hierarchy Converting Objects and Simple Variables Casting Simple Variables Casting Objects Converting Simple Variables to Objects and Back Creating an Object HOUR 11: Describing What Your Object Is Like Creating Variables Creating Class Variables Creating Behavior with Methods Declaring a Method Similar Methods with Different Arguments Constructors Class Methods Variable Scope within Methods Putting One Class Inside Another Using the this Keyword Using Class Methods and Variables HOUR 12: Making the Most of Existing Objects The Power of Inheritance Inheriting Behavior and Attributes Overriding Methods Establishing Inheritance Using this and super in a Subclass Working with Existing Objects Storing Objects of the Same Class in Array Lists Looping Through an Array List Creating a Subclass PART IV: Moving into Advanced Topics HOUR 13: Storing Objects in Data Structures Array Lists Hash Maps HOUR 14: Handling Errors in a Program Exceptions Catching Exceptions in a try-catch Block Catching Several Different Exceptions Handling Something After an Exception Throwing Exceptions Ignoring Exceptions Exceptions That Don’t Need catch Throwing and Catching Exceptions HOUR 15: Creating a Threaded Program Threads Slowing Down a Program Creating a Thread Working with Threads The class Declaration Setting Up Variables The Constructor Catching Errors as You Set Up URLs Starting the Thread Running the Thread Handling Mouse Clicks Displaying Revolving Links Stopping a Thread HOUR 16: Using Inner Classes and Closures Inner Classes Anonymous Inner Classes Closures PART V: Programming a Graphical User Interface Code Snippets Code Snippets Code Snippets ... Storing Text in Strings Displaying Strings in Programs Using Special Characters in Strings Pasting Strings Together Using Other Variables with Strings Advanced String Handling Comparing Two Strings... Storing Information in a Variable Displaying the Contents of a Variable Saving the Finished Product Compiling the Program into a Class File Fixing Errors Running a Java Program HOUR 3: Vacationing... Creating Minecraft Mods with Java Setting Up a Minecraft Server Fixing Problems Running the Server Connecting to the Server Fixing a Server Connection Problem Creating Your First Mod Teaching

Ngày đăng: 02/03/2019, 10:59

Từ khóa liên quan

Mục lục

  • Title Page

  • Copyright Page

  • Dedication

  • Table of Contents

  • Introduction

  • PART I: Getting Started

    • HOUR 1: Becoming a Programmer

      • Choosing a Language

      • Telling the Computer What to Do

      • How Programs Work

      • When Programs Don–t Work

      • Choosing a Java Programming Tool

      • Installing a Java Development Tool

      • HOUR 2: Writing Your First Program

        • What You Need to Write Programs

        • Creating the Saluton Program

        • Beginning the Program

          • The class Statement

          • What the main Statement Does

          • Those Squiggly Bracket Marks

          • Storing Information in a Variable

            • Displaying the Contents of a Variable

            • Saving the Finished Product

            • Compiling the Program into a Class File

            • Fixing Errors

Tài liệu cùng người dùng

Tài liệu liên quan