
《数据结构与问题求解(Java语言版)(第4版)(影印版)》:大学计算机教育国外著名教材系列 |
作者:(美国)韦斯(Mark Allen Weiss) .. << 查看详细 |
| part one tour of java 1 primitive java 1.1 the general environment 4 1.2 the first program 5 1.2.1 comments 5 1.2.2 mai n 6 1.2.3 terminal output 6 1.3 primitive types 6 1.3.1 the primitive types 6 1.3.2 constants 7 1.3.3 declaration and initialization of primitive types 1.3.4 terminal input and output 8 1.4 basic operators 8 1.4.1 assignment operators 9 1.4.2 binary arithmetic operators 10 1.4.3 unary operators 10 1.4.4 type conversions 10 1.5 conditional statements 11 1.5.1 relational and equality operators 1.5.2 logical operators 12 .1.5.3 the if statement 13 1.5.4 the while statement 14 1.5.5 the for statement 14 1.5.6 the do statement 15 1.5.7 break and continue 16 1.5.8 the switch statement 17 1.5.9 the conditional operator 17 1.6 methods 18 1.6.1 overloading of method names 19 1.6.2 storage classes 20 summary 20 key concepts 20 common errors 22 on the internet 23 exercises 23 references 25 2 reference types 2.1 whet is a reference? 27 2.2 basics of objects and references 3o 2.2.1 the dot operator (.) 30 2.2.2 declaration of objects 30 2.2.3 garbage collection 31 2.2.4 the meaning of= 32 2.2.5 parameter passing 33 2.2.6 the meaning of== 33 2.2.7 no operator overloading for objects 34 2.3 strings 35 2.3.1 basics of string manipulation 35 2.3.2 string concatenation 35 2.3.3 comparing strings 36 2.3.4 other string methods 36 2.3.5 converting other types to strings 37 2.4 arrays 37 2.4.1 declaration. assignment and methods 38 2.4.2 dynamic array expansion 40 2.4.3 arrayli st 42 2.4.4 multidimensional arrays 45 2.4.5 command-line arguments 45 2.4.6 enhanced for loop 46 2.5 exception handling 47 2.5.1 processing exceptions 48 2.5.2 the finally clause 48 2.5.3 common exceptions 49 2.5.4 the throw and throws clauses 51 2.6 input and output 51 2.6.1 basic stream operations 52 2.6.2 the scanner type 53 2.6.3 sequential files 56 summary 59 key concepts 60 common errors 61 on the internet 62 exercises 62 references 68 3 objects and classes 3.1 what is object-oriented programming? 69 3.2 a simple example 71 3.3 javadoc 73 3.4 basic methods 76 3.4.1 constructors 76 3.4.2 mutators and accessors 76 3.4.3 output and tostring 78 3.4.4 equals 78 3.4.5 main 78 3.5 example: using java.math.biginteger 78 3.6 additional constructs 79 3.6.1 the this reference 81 3.6.2 the this shorthand for constructors 82 3.6.3 the instanceof operator 82 3.6.4 instance members versus static members 83 3.6.5 static fields and methods 83 3.6.6 static initializers 86 3.7 example: implementing a bigrational class 86 3.8 packages 90 3.8.1 the import directive 91 3.8.2 the package statement 93 3.8.3 the lasspath environment variable 94 3.8.4 package visibility rules 95 3.9 a design pattern: composite (pair) 95 summary 96 key concepts 97 common errors 100 on the internet 100 exercises 101 references 107 4 inheritance 4.1 what is inheritance? 110 4.1.1 creating new classes 110 4.1.2 type compatibility 115 4.1.3 dynamic dispatch and polymorphism 116 4.1.4 inheritance hierarchies 117 4.1.5 visibility rules 117 4.1.6 the constructor and super 118 4.1.7 final methods and classes 119 4.1.8 overriding a method 121 4.1.9 type compatibility revisited 121 4.1.1o compatibility of array types 124 4.1.11 covariant return types 124 4.2 designing hierarchies 125 4.2.1 abstract methods and classes 126 4.2.2 designing for the future 130 4.3 multiple inheritance 131 4.4 the interface 134 4.4.1 specifying an interface 134 4.4.2 implementing an interface 135 4.4.3 multiple interfaces 135 4.4.4 interfaces are abstract classes 136 …… part two algorithms and building blocks 6 the collections api 7 recursion 8 sorting algorithms 9 randomization part three applications 10 fun and games 11 stacks and compilers 12 utilities …… |
商品评论(0条)