出版時間:2008-11 出版社:人民郵電出版社 作者:(美)Cay S.Horstmann Gary Cornel 頁數(shù):836
Tag標簽:無
前言
1995年底,Java語言在Intemet舞臺上一亮相便名聲大噪。其原因在于它將有望成為通過信息將用戶聯(lián)系起來的“萬能膠”,而不論這些信息來自于Web服務(wù)器、數(shù)據(jù)庫、信息提供商,還是任何其他渠道。事實上,就發(fā)展前景而言,Java的地位是獨一無二的。它是一種完全可以信賴的程序設(shè)計語言,得到了除微軟之外所有廠家的認可。其固有的可靠性與安全性不僅令Java程序員放心,也令使用Java程序的用戶放心。Java內(nèi)建了對網(wǎng)絡(luò)編程、數(shù)據(jù)庫連接、多線程等高級程序設(shè)計任務(wù)的支持。 1995年以來,SUN MicroSystems公司已經(jīng)發(fā)布了Java開發(fā)工具箱(Java Development Kit)的7個主要版本。在過去的11年中,應(yīng)用程序接口(API)已經(jīng)從200個類擴展到3000個類,并覆蓋了用戶界面構(gòu)建、數(shù)據(jù)庫管理、國際化、安全性以及XML處理等各個不同的領(lǐng)域。 本書是《Java核心技術(shù)》第8版的卷I。自《Java核心技術(shù)》出版以來,每個新版本都盡可能快地跟上Java開發(fā)工具箱發(fā)展的步伐,并重新改寫部分內(nèi)容,以適應(yīng)Java的最新特性。在這一版中,已經(jīng)反映了Java標準版(Java SE 6)的特性?! ∨c前幾版一樣,本版仍然將讀者群定位在那些打算將Java應(yīng)用到實際工程項目中的程序設(shè)計人員。本書假設(shè)讀者是一名具有程序設(shè)計語言(除Java之外)堅實背景知識的程序設(shè)計人員,并且不希望書中充斥著玩具式的示例(諸如烤面包機、動物園的動物或神經(jīng)質(zhì)的跳動文本)。這些內(nèi)容絕對不會在本書中出現(xiàn)。本書的目標是讓讀者充分地理解書中介紹的Java語言及Java類庫的相關(guān)特性,而不會產(chǎn)生任何誤解?! ≡诒緯?,我們選用大量的示例代碼演示所討論的每一個語言特性和類庫特性。我們有意使用簡單的示例程序以突出重點,然而,其中的大部分既不是贗品也沒有偷工減料。它們將成為讀者自己編寫代碼的良好開端。
內(nèi)容概要
《Java核心技術(shù)卷1:基礎(chǔ)知識(第8版)(英文版)》第1版出版以來,一直備受廣大Java程序設(shè)計人員的青睞,暢銷不衰,是Java經(jīng)典書籍。第8版針對Java SE 6平臺進行了全面更新,囊括了Java 2平臺、標準版(J2SE)的全部基礎(chǔ)知識,提供了大量完整且具有實際意義的應(yīng)用實例,詳細介紹了Java語言基礎(chǔ)知識、面向?qū)ο蟪绦蛟O(shè)計、接口與內(nèi)部類、事件監(jiān)聽器模型、Swing圖形用戶界面程序設(shè)計、打包應(yīng)用程序、異常處理、登錄與調(diào)試、泛型程序設(shè)計、集合框架、多線程等內(nèi)容?!禞ava核心技術(shù)卷1:基礎(chǔ)知識(第8版)(英文版)》示例程序經(jīng)過精心設(shè)計,不但具有實用價值,而且易于閱讀理解,可以作為初學(xué)者自己編寫程序的良好開端,也能夠幫助程序員快速地了解Java SE 6的新特性,或迅速從其他語言轉(zhuǎn)向Java語言。
書籍目錄
Contents1 AN INTRODUCTION TO JAVAJava As a Programming PlatformThe Java “White Paper” Buzzwords Simple Object Oriented Network-Savvy Robust Secure Architecture Neutral Portable Interpreted High Performance Multithreaded DynamicJava Applets and the InternetA Short History of JavaCommon Misconceptions about Java2 THE JAVA PROGRAMMING ENVIRONMENTInstalling the Java Development Kit Downloading the JDK Setting the Execution Path Installing the Library Source and Documentation Installing the Core Java Program Examples Navigating the Java DirectoriesChoosing a Development EnvironmentUsing the Command-Line Tools Troubleshooting HintsUsing an Integrated Development Environment Locating Compilation ErrorsRunning a Graphical ApplicationBuilding and Running Applets3 FUNDAMENTAL PROGRAMMING STRUCTURES IN JAVAA Simple Java ProgramCommentsData Types Integer Types Floating-Point Types The char Type The boolean TypeVariablesInitializing Variables ConstantsOperators Increment and Decrement Operators Relational and boolean Operators Bitwise Operators Mathematical Functions and Constants Conversions between Numeric Types Casts Parentheses and Operator Hierarchy Enumerated TypesStrings Substrings Concatenation Strings Are Immutable Testing Strings for Equality Code Points and Code Units The String API Reading the On-Line API Documentation Building StringsInput and Output Reading Input Formatting Output File Input and OutputControl Flow Block Scope Conditional Statements Loops Determinate Loops Multiple Selections——The switch Statement Statements That Break Control FlowBig NumbersArrays The “for each” Loop Array Initializers and Anonymous Arrays Array Copying Command-Line Parameters Array Sorting Multidimensional Arrays Ragged Arrays4 OBJECTS AND CLASSESIntroduction to Object-Oriented Programming Classes Objects Identifying Classes Relationships between ClassesUsing Predefined Classes Objects and Object Variables The GregorianCalendar Class of the Java Library Mutator and Accessor MethodsDefining Your Own Classes An Employee Class Use of Multiple Source Files Dissecting the Employee Class First Steps with Constructors Implicit and Explicit Parameters Benefits of Encapsulation Class-Based Access Privileges Private Methods Final Instance FieldsStatic Fields and Methods Static Fields Static Constants Static Methods Factory Methods The main MethodMethod ParametersObject Construction Overloading Default Field Initialization Default Constructors Explicit Field Initialization Parameter Names Calling Another Constructor Initialization Blocks Object Destruction and the finalize MethodPackages Class Importation Static Imports Addition of a Class into a Package Package ScopeThe Class Path Setting the Class PathDocumentation Comments Comment Insertion Class Comments Method Comments Field Comments General Comments Package and Overview Comments Comment ExtractionClass Design Hints5 INHERITANCEClasses, Superclasses, and Subclasses Inheritance Hierarchies Polymorphism Dynamic Binding Preventing Inheritance: Final Classes and Methods Casting Abstract Classes Protected AccessObject: The Cosmic Superclass The equals Method Equality Testing and Inheritance The hashCode Method The toString MethodGeneric Array Lists Accessing Array List Elements Compatibility between Typed and Raw Array ListsObject Wrappers and AutoboxingMethods with a Variable Number of ParametersEnumeration ClassesReflection The Class Class A Primer on Catching Exceptions Using Reflection to Analyze the Capabilities of Classes Using Reflection to Analyze Objects at Runtime Using Reflection to Write Generic Array Code Method Pointers!Design Hints for Inheritance6 INTERFACES AND INNER CLASSESInterfaces Properties of Interfaces Interfaces and Abstract ClassesObject CloningInterfaces and CallbacksInner Classes Use of an Inner Class to Access Object State Special Syntax Rules for Inner Classes Are Inner Classes Useful? Actually Necessary? Secure? Local Inner Classes Accessing final Variables from Outer Methods Anonymous Inner Classes Static Inner ClassesProxies Properties of Proxy Classes7 GRAPHICS PROGRAMMINGIntroducing SwingCreating a FramePositioning a Frame Frame Properties Determining a Good Frame SizeDisplaying Information in a ComponentWorking with D ShapesUsing ColorUsing Special Fonts for TextDisplaying Images8 EVENT HANDLINGBasics of Event Handling Example: Handling a Button Click Becoming Comfortable with Inner Classes Creating Listeners Containing a Single Method Call Example: Changing the Look and Feel Adapter ClassesActionsMouse EventsThe AWT Event HierarchySemantic and Low-Level Events9 USER INTERFACE COMPONENTS WITH SWINGSwing and the Model-View-Controller Design Pattern Design Patterns The Model-View-Controller Pattern A Model-View-Controller Analysis of Swing ButtonsIntroduction to Layout Management Border Layout Grid LayoutText Input Text Fields Labels and Labeling Components Password Fields Text Areas Scroll PanesChoice Components Checkboxes Radio Buttons Borders Combo Boxes SlidersMenus Menu Building Icons in Menu Items Checkbox and Radio Button Menu Items Pop-Up Menus Keyboard Mnemonics and Accelerators Enabling and Disabling Menu Items Toolbars TooltipsSophisticated Layout Management The Grid Bag Layout Group Layout Using No Layout Manager Custom Layout Managers Traversal OrderDialog Boxes Option Dialogs Creating Dialogs Data Exchange File Dialogs Color Choosers10 DEPLOYING APPLICATIONS AND APPLETSJAR Files The Manifest Executable JAR Files Resources SealingJava Web Start The Sandbox Signed Code The JNLP APIApplets A Simple Applet The Applet HTML Tag and Its Attributes The object Tag Use of Parameters to Pass Information to Applets Accessing Image and Audio Files The Applet ContextStorage of Application Preferences Property Maps The Preferences API11 EXCEPTIONS, LOGGING, ASSERTIONS, AND DEBUGGINGDealing with Errors The Classification of Exceptions Declaring Checked Exceptions How to Throw an Exception Creating Exception ClassesCatching Exceptions Catching Multiple Exceptions Rethrowing and Chaining Exceptions The finally Clause Analyzing Stack Trace ElementsTips for Using ExceptionsUsing Assertions Assertion Enabling and Disabling Using Assertions for Parameter Checking Using Assertions for Documenting AssumptionsLogging Basic Logging Advanced Logging Changing the Log Manager Configuration Localization Handlers Filters Formatters A Logging RecipeDebugging Tips Using a Console Window Tracing AWT Events Letting the AWT Robot Do the WorkUsing a Debugger12 GENERIC PROGRAMMINGWhy Generic Programming? Who Wants to Be a Generic Programmer?Definition of a Simple Generic ClassGeneric MethodsBounds for Type VariablesGeneric Code and the Virtual Machine Translating Generic Expressions Translating Generic Methods Calling Legacy CodeRestrictions and Limitations Type Parameters Cannot Be Instantiated with Primitive Types Runtime Type Inquiry Only Works with Raw Types You Cannot Throw or Catch Instances of a Generic Class Arrays of Parameterized Types Are Not Legal You Cannot Instantiate Type Variables Type Variables Are Not Valid in Static Contexts of Generic Classes Beware of Clashes After ErasureInheritance Rules for Generic TypesWildcard Types Supertype Bounds for Wildcards Unbounded Wildcards Wildcard CaptureReflection and Generics Using Class Parameters for Type Matching Generic Type Information in the Virtual Machine13 COLLECTIONSCollection Interfaces Separating Collection Interfaces and Implementation Collection and Iterator Interfaces in the Java LibraryConcrete Collections Linked Lists Array Lists Hash Sets Tree Sets Object Comparison Queues and Deques Priority Queues Maps Specialized Set and Map ClassesThe Collections Framework Views and Wrappers Bulk Operations Converting between Collections and ArraysAlgorithms Sorting and Shuffling Binary Search Simple Algorithms Writing Your Own AlgorithmsLegacy Collections The Hashtable ClassEnumerations Property Maps Stacks Bit Sets14 MULTITHREADINGWhat Are Threads? Using Threads to Give Other Tasks a ChanceInterrupting ThreadsThread States New Threads Runnable Threads Blocked and Waiting Threads Terminated ThreadsThread Properties Thread Priorities Daemon Threads Handlers for Uncaught ExceptionsSynchronization An Example of a Race Condition The Race Condition Explained Lock Objects Condition Objects The synchronized Keyword Synchronized Blocks The Monitor Concept Volatile Fields Deadlocks Lock Testing and Timeouts Read/Write Locks Why the stop and suspend Methods Are DeprecatedBlocking QueuesThread-Safe Collections Efficient Maps, Sets, and Queues Copy on Write Arrays Older Thread-Safe CollectionsCallables and FuturesExecutors Thread Pools Scheduled Execution Controlling Groups of TasksSynchronizersSemaphores Countdown Latches Barriers Exchangers Synchronous Queues Example: Pausing and Resuming an AnimationThreads and Swing Running Time-Consuming Tasks Using the Swing Worker The Single-Thread RuleAppendixIndex
編輯推薦
《Java核心技術(shù)卷1:基礎(chǔ)知識(第8版)(英文版)》是Java實際項目應(yīng)用的權(quán)威指導(dǎo)書?!禞ava核心技術(shù)卷1:基礎(chǔ)知識(第8版)(英文版)》作者Cav S.Horstmann是圣何塞州立大學(xué)計算機科學(xué)系教授、Java的倡導(dǎo)者?! arv Cornell擁有20余年程序設(shè)計專業(yè)課程教學(xué)經(jīng)驗,撰寫過多本專著,曾獲得Jolt大獎提名?! 禞ava核心技術(shù)卷1:基礎(chǔ)知識(第8版)(英文版)》針對Java SE 6平臺進行了全面更新,并通過大量經(jīng)過測試的示例說明了最重要的語言特性和類庫特性。這些示例程序經(jīng)過精心設(shè)計,不但具有實用價值,而且易閱讀和理解,可以作為讀者自己編寫程序的良好開端。本卷詳細介紹以下內(nèi)容: Java語言基礎(chǔ)知識; Swing圖形用戶界面程序設(shè)計; 泛型程序設(shè)計; 面向?qū)ο蟪绦蛟O(shè)計; 打包應(yīng)用程序; 集合框架; 接口與內(nèi)部類; 異常處理; 多線程。 事件監(jiān)聽器模型; 登錄與調(diào)試。
圖書封面
圖書標簽Tags
無
評論、評分、閱讀與下載