- ホーム
- > 洋書
- > 英文書
- > Computer / Languages
Full Description
In just 21 days you can acquire the knowledge and skills necessary to develop applications on your computer and apps that run on Android phones and tablets. With this complete tutorial you'll quickly master the basics and then move on to more advanced features and concepts. Completely updated for Java 8, this book teaches you about the Java language and how to use it to create applications for any computing environment and Android apps. By the time you have finished the book, you'll have well-rounded knowledge of Java and the Java class libraries. Using your new skills, you will be able to develop your own programs for tasks such as web services, database connectivity, XML processing, and mobile programming.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 8Learn to develop Java applications and Android apps using NetBeans and Google's new Android Studio -- two excellent (and free!) programming platformsCovers new features of Java 8 such as closures, the most eagerly anticipated language feature in yearsEasy-to-understand, practical examples clearly illustrate the fundamentals of Java programmingDiscover how Swing can help you quickly develop programs with a graphical user interfaceFind out about JDBC 4.2 programming with the Derby database and XML parsing with the open source XOM class libraryLearn how to use streams to write programs that communicate with the Internet, including socket programming, buffers, channels, and URL handling. Contents at a Glance WEEK 1: The Java Language DAY 1 Getting Started with Java DAY 2 The ABCs of Programming DAY 3 Working with Objects DAY 4 Lists, Logic, and Loops DAY 5 Creating Classesand Methods DAY 6 Packages, Interfaces, and Other Class Features DAY 7 Exceptions and Threads WEEK 2: The Java Class Library DAY 8 Data Structures DAY 9 Working with Swing DAY 10 Building a Swing Interface DAY 11 Arranging Components on a User Interface DAY 12 Responding to User Input DAY 13 Creating Java2D Graphics DAY 14 Developing Swing Applications WEEK 3: Java Programming DAY 15 Working with Input and Output DAY 16 Using Inner Classes and Closures DAY 17 Communicating Across the Internet DAY 18 Accessing Databases with JDBC 4.2 and Derby DAY 19 Reading and Writing RSS Feeds DAY 20 XML Web Services DAY 21 Writing Android Apps for Java APPENDIX A Using the NetBeans IDE APPENDIX B This Book's Website APPENDIX C Fixing a Problem with the Android Studio Emulator APPENDIX D Using the Java Development Kit APPENDIX E Programming with the Java Development Kit
Contents
IntroductionWEEK I: The Java Language DAY 1: Getting Started with JavaThe Java LanguageHistory of the LanguageIntroduction to JavaSelecting a Development Tool Object-Oriented ProgrammingObjects and ClassesAttributes and BehaviorAttributes of a Class of ObjectsBehavior of a Class of ObjectsCreating a ClassRunning the ProgramOrganizing Classes and Class BehaviorInheritanceCreating a Class HierarchyInheritance in ActionInterfacesPackagesDAY 2: The ABCs of Programming Statements and ExpressionsVariables and Data TypesCreating VariablesNaming VariablesVariable TypesAssigning Values to VariablesConstantsCommentsLiteralsNumber LiteralsBoolean LiteralsCharacter LiteralsString LiteralsExpressions and OperatorsArithmeticMore About AssignmentIncrementing and DecrementingComparisonsLogical OperatorsOperator PrecedenceString Arithmetic DAY 3: Working with ObjectsCreating New ObjectsHow Objects Are Constructed A Note on Memory Management Using Class and Instance VariablesGetting ValuesSetting ValuesClass VariablesCalling MethodsFormatting StringsNesting Method CallsClass MethodsReferences to ObjectsCasting Objects and Primitive TypesCasting Primitive TypesCasting ObjectsConverting Primitive Types to Objects and Vice VersaComparing Object Values and ClassesComparing ObjectsDetermining the Class of an ObjectDAY 4: Lists, Logic, and LoopsArraysDeclaring Array VariablesCreating Array ObjectsAccessing Array Elements Changing Array Elements Multidimensional ArraysBlock Statements If ConditionalsSwitch ConditionalsThe Ternary OperatorFor Loops While and Do LoopsWhile LoopsDo-While LoopsBreaking Out of Loops Labeled LoopsDAY 5: Creating Classes and MethodsDefining ClassesCreating Instance and Class VariablesDefining Instance VariablesClass VariablesCreating MethodsDefining MethodsThe this KeywordVariable Scope and Method DefinitionsPassing Arguments to MethodsClass MethodsCreating Java ApplicationsHelper ClassesJava Applications and ArgumentsPassing Arguments to Java ApplicationsHandling Arguments in Your Java ApplicationCreating Methods with the Same NameConstructorsBasic ConstructorsCalling Another ConstructorOverloading ConstructorsOverriding MethodsCreating Methods That Override Existing MethodsCalling the Original MethodOverriding Constructors DAY 6: Packages, Interfaces, and Other Class Features ModifiersAccess Control for Methods and VariablesStatic Variables and MethodsFinal Classes, Methods, and VariablesVariablesMethodsClassesAbstract Classes and MethodsPackagesThe import DeclarationClass Name ConflictsCreating Your Own PackagesPicking a Package NameCreating the Folder StructureAdding a Class to a PackagePackages and Class Access ControlInterfacesThe Problem of Single InheritanceInterfaces and ClassesImplementing and Using InterfacesImplementing Multiple InterfacesOther Uses of InterfacesCreating and Extending InterfacesNew InterfacesMethods Inside InterfacesExtending InterfacesCreating an Online StorefrontDAY 7: Exceptions and ThreadsExceptionsException ClassesManaging ExceptionsException Consistency CheckingProtecting Code and Catching ExceptionsThe finally ClauseDeclaring Methods That Might Throw ExceptionsThe throws ClauseWhich Exceptions Should You Throw Passing on Exceptionsthrows and InheritanceCreating and Throwing ExceptionsThrowing ExceptionsCreating Your Own ExceptionsCombining throws, try, and throwWhen Not to Use ExceptionsBad Style Using ExceptionsThreadsWriting a Threaded ProgramA Threaded ApplicationStopping a ThreadWEEK II: The Java Class LibraryDAY 8: Data StructuresMoving Beyond ArraysJava StructuresIteratorBit SetsArray ListsLooping Through Data StructuresStacksMapHash MapsGenerics EnumerationsDAY 9: Working with SwingCreating an ApplicationCreating an InterfaceDeveloping a FrameworkCreating a ComponentAdding Components to a Container Working with ComponentsImage IconsLabelsText FieldsText AreasScrolling PanesCheck Boxes and Radio Buttons Combo BoxesListsThe Java Class LibraryDAY 10: Building a Swing InterfaceSwing FeaturesStandard Dialog BoxesUsing Dialog BoxesSlidersScroll PanesToolbarsProgress BarsMenusTabbed PanesDAY 11: Arranging Components on a User InterfaceBasic Interface LayoutLaying Out an InterfaceFlow LayoutBox LayoutGrid LayoutBorder LayoutMixing Layout ManagersCard LayoutUsing Card Layout in an ApplicationCell Padding and InsetsDAY 12: Responding to User InputEvent ListenersSetting Up ComponentsEvent-Handling MethodsWorking with MethodsAction EventsFocus EventsItem EventsKey EventsMouse EventsMouse Motion EventsWindow EventsUsing Adapter ClassesUsing Inner ClassesDAY 13: Creating Java2D GraphicsThe Graphics2D ClassThe Graphics Coordinate SystemDrawing TextImproving Fonts and Graphics with AntialiasingFinding Information About a FontColor Using Color ObjectsTesting and Setting the Current ColorsDrawing Lines and PolygonsUser and Device Coordinate SpacesSpecifying the Rendering Attributes Creating Objects to DrawDrawing ObjectsDAY 14: Developing Swing ApplicationsJava Web StartUsing Java Web StartCreating a JNLP FileSupporting Web Start on a ServerAdditional JNLP ElementsImproving Performance with SwingWorkerWEEK III: Java ProgrammingDAY 15: Working with Input and OutputIntroduction to StreamsUsing a StreamFiltering a StreamHandling ExceptionsByte StreamsFile StreamsFiltering a StreamByte FiltersCharacter StreamsReading Text FilesWriting Text FilesFiles and PathsDAY 16: Using Inner Classes and ClosuresInner ClassesAnonymous Inner ClassesClosuresDAY 17: Communicating Across the InternetNetworking in JavaOpening a Stream Over the NetSocketsSocket ServersTesting the ServerThe java.nio PackageBuffersChannelsDAY 18: Accessing Databases with JDBC 4.2 and DerbyJava Database ConnectivityDatabase DriversExamining a DatabaseReading Records from a DatabaseWriting Records to a DatabaseMoving Through ResultsetsDAY 19: Reading and Writing RSS FeedsUsing XML Designing an XML DialectProcessing XML with Java Processing XML with XOMCreating an XML DocumentModifying an XML DocumentFormatting an XML DocumentEvaluating XOMDAY 20: XML Web ServicesIntroduction to XML-RPCCommunicating with XML-RPCSending a RequestResponding to a RequestChoosing an XML-RPC ImplementationUsing an XML-RPC Web ServiceCreating an XML-RPC Web ServiceDAY 21: Writing Android Apps with JavaThe History of AndroidWriting an Android AppOrganizing an Android ProjectCreating the ProgramRunning the AppDesigning an Android App Preparing ResourcesConfiguring a Manifest FileDesigning the Graphical User Interface Writing CodeAPPENDIXESAPPENDIX A: Using the NetBeans Integrated Development Environment Installing NetBeansCreating a New Project Creating a New Java Class Running the Application Fixing Errors Expanding and Shrinking a PaneExploring NetBeansAPPENDIX B: This Book's Website APPENDIX C: Fixing a Problem with the Android Studio EmulatorProblems Running an AppInstall HAXM in Android StudioInstall HAXM on Your Computer Checking BIOS SettingsAPPENDIX D: Using the Java Development Kit Choosing a Java Development ToolInstalling the Java Development KitConfiguring the Java Development KitUsing a Text EditorCreating a Sample ProgramCompiling and Running the Program in WindowsSetting Up the CLASSPATH VariableAPPENDIX E: Programming with the Java Development KitOverview of the JDKThe java Virtual MachineThe javac CompilerThe appletviewer BrowserThe javadoc Documentation ToolThe jar Java File Archival ToolThe jdb DebuggerDebugging ApplicationsDebugging AppletsAdvanced Debugging CommandsUsing System PropertiesThe keytool and jarsigner Code Signing Tools