1
1....6 1.1...6 2. Java Architecture...7 2.1 2SDK(Software Development Kit)...8 2.2 JRE(Java Runtime Environment)...9 2.3 (Java Virtual Machine, JVM)...10 2.4 JVM...11 2.5 (runtime)jvm...12 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 heap...12 2.5.1.1 OutOfMemory Error...13 Stack...13 method area...14 Register...14 runtime constant pool( )...14...14 2.6 Java...15 2.6.7 2.6.8 2.6.9 2.6.10 2.6.11 2.6.12 2.6.13 2.6.11.1 2.6.11.2 2.6.11.3 2.6.13.1 2.6.13.2 Scalability...15 Security...15 Universality...15 Modularity...16 Thread...16 Proccess...16 Thread...16 java.lang.runnable...16 Garbage Collection...17 Exception...17 Runtime Exception...18 compiletime Exception...18 2.7 SDK...18 2.7.14 2.7.15 2.7.16 2.7.14.1 Class & Package...18...18 Java API Documentation(Java Application Programming Interface)...19 Java Tutorial...19 2
2.7.17 Identifier...19 2.8 A Basic Java Application ( )...20 2.8.18 2.8.19 2.8.20 2.8.18.1 2.8.19.1 2.8.19.2 2.8.19.3 2.8.20.1 Compiler...20 javac...20 Interpreter...22 java...22 java...22...23...24 javap...24 3. Identifiers,Keywords,Types, and Flow Control...26 3.1 Keywords...26 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.1.10 3.1.11 3.1.12 Interface...26 3.1.1.1...28 3.1.1.2...28 Import...28 this...28 static...29 final...30 3.1.5.1 Blank final...30 3.1.5.2 final...30 3.1.5.3 final Methods...31 3.1.5.4 binding...31 super...31 return...31 instanceof...32 transient...32 volatile...32 native...33 strictfp... 33 3.2 Variable & Constants ( )...33 3.2.13 3.2.14 3.2.15 Constants...33 Local variable...34 Member variable...34 3.3 Data type...34 3.3.16 Primitive Types...34 3
3.3.17 3.3.18 3.3.19 3.3.20 3.3.21 3.3.22 3.3.16.1 3.3.16.2 3.3.16.3 3.3.16.4 Integral...34 Floating...35 Logical...35 Textual...35 Non-Primitive type Reference Types...36 field...36 Signature ( )...36 3.3.22.1 3.3.22.2 3.3.22.3 name space ( )...36 aliasing...36 Operator...37 3.3.22.4 3.3.22.5 3.3.22.6 3.3.22.7 3.3.22.8 3.3.22.9 3.3.22.10 3.3.22.11 3.3.22.12 3.3.22.13 unary Operator ( )...37 assignment Operator ( )...37 mathematical Operator( )...37...37 relational Operators...37 Logical Operators and Short-Circuit Logical Operators...37 bitwise Operators...38 Shift Operators...38 Ternary Operators ( )...39 Cast Operators...39 Coma Operators...39 String Concatenation With +...39...40 3.4 Arrays...40 3.4.23 3.4.24 Objectives Arrays...41 Multidimensional Arrays...41 3.5 Branching Statements ()...42 3.5.25 label...42 4. Object Oriented Programming...43 4.1 Class Object...43 4.1.1 4.1.2 4.1.3 4.1.4 Class...43 Object...43 Class Object...44 Accessing Object Members...44 4.2 Access Modifier...44 4.2.5...44 4
4.2.6...45 4.3 Object-Oriented Programming Language (OOPL)3 concept...45 4.3.7 4.3.8 4.3.9 Polymorphism...45 inheritance...46 4.3.8.1 substitution principle( )...46 4.3.8.2 composition...46 4.3.8.3 pure substitution( )is-like-a...47 4.3.8.4 upcasting...47 encapsulation...47 5. Java Basic Grammar...49 5.1 Construct...49 5.2 abstract...49 5.3 Overriding...50 5.3.1 5.3.2 closure...50 call back...50 5.4 Overloading...50 5.5 Constructor...51 5.6 tostring()...51 5.7 Inner class...51 5.8 Wrapper Class...52 5.9 Local class...52 5.10 Anonymous class...53 5.11 Collection API...54 5.11.3 5.11.4 5.11.5 5.11.6 Collection interface...55 Set interface...55 List / ListIterator interface...56 Map interface...56 5.12 Reflection API...57 5.13 Vector...57 5.14 Heterogeneous Collections...57 5.15 Exception...58 5.16 Handle or Declare...60 5.17 static inner class...61 5.18 finally...62 5
1. 1.1 6
1 2. Java Architecture 7
2.1 2SDK(Software Development Kit) 1 Jar Java Archive, 8
2.2 JRE(Java Runtime Environment) 2 : core " ".,, 9
1 2.3 (Java Virtual Machine, JVM) 10
2.4 JVM 11
2.5 (runtime) JVM 2.5.1 heap 12
2.5.1.1 OutOfMemory Error 2.5.2 Stack 3 (operand stack). 13
1 2.5.3 method area 2.5.4 Register 2.5.5 runtime constant pool( ) 2.5.6 14
2.6 Java 2.6.7 Scalability 2.6.8 Security 2.6.9 Universality 15
1 2.6.10 Modularity 2.6.11 Thread 2.6.11.1 Proccess 2.6.11.2 Thread 2.6.11.3 java.lang.runnable 16
1 2.6.12 Garbage Collection 2.6.13 Exception 17
2.6.13.1 Runtime Exception 2.6.13.2 compiletime Exception 2.7 SDK 2.7.14 Class & Package 2.7.14.1 18
2.7.15 Java API Documentation(Java Application Programming Interface) 2.7.16 Java Tutorial 2.7.17 Identifier 19
2.8 A Basic Java Application () 2.8.18 Compiler (1) 2.8.18.1 javac 4 5 : Java Virtual Machine(Java VM) 20
1 21
2.8.19 Interpreter 2.8.19.1 java 2.8.19.2 java 22
1 2.8.19.3 23
1 2.8.20 2.8.20.1 javap 24
1 25
3. Identifiers,Keywords,Types, and Flow Control 3.1 Keywords 3.1.1 Interface 26
1 27
1 3.1.1.1 3.1.1.2 3.1.2 Import 3.1.3 this 28
1 3.1.4 static 29
1 3.1.5 final 3.1.5.1 Blank final 3.1.5.2 final 30
1 3.1.5.3 final Methods 3.1.5.4 binding 3.1.6 super 3.1.7 return 6 (inline). 7 5.25.4 binding 31
1 instanceof 3.1.9 transient 3.1.10 volatile 32
3.1.11 native 3.1.12 strictfp 3.2 Variable & Constants ( ) 3.2.13 Constants 8. 1 2. UTF-8 33
3.2.14 Local variable 3.2.15 Member variable 3.3 Data type 3.3.16 Primitive Types 3.3.16.1 Integral 34
3.3.16.2 Floating 3.3.16.3 Logical 3.3.16.4 Textual 35
3.3.17 Non-Primitive type Reference Types 3.3.18 field 3.3.19 Signature ( ) 3.3.20 name space ( ) 3.3.21 aliasing 36
3.3.22 Operator 3.3.22.1 unary Operator ( ) 3.3.22.2 assignment Operator ( ) 3.3.22.3 mathematical Operator( ) 3.3.22.4 3.3.22.5 relational Operators 3.3.22.6 Logical Operators and Short-Circuit Logical Operators 9 short_circuit : (true or false) 37
3.3.22.7 bitwise Operators 3.3.22.8 Shift Operators 10 (bit) : binary digit 01. 38
3.3.22.9 Ternary Operators ( ) 3.3.22.10 Cast Operators 3.3.22.11 Coma Operators 3.3.22.12 String Concatenation With + 39
3.3.22.13 3.4 Arrays 40
1 3.4.23 Objectives Arrays 3.4.24 Multidimensional Arrays 41
3.5 Branching Statements ( ) 3.5.25 label 11 identifier : 42
4. Object Oriented Programming 4.1 Class Object 4.1.1 Class 4.1.2 Object 43
4.1.3 Class Object 4.1.4 Accessing Object Members 4.2 Access Modifier 4.2.5 44
4.2.6 4.3 Object-Oriented Programming Language (OOPL)3 concept 4.3.7 Polymorphism 45
1 4.3.8 inheritance 4.3.8.1 substitution principle( ) 4.3.8.2 composition 46
1 4.3.8.3 pure substitution( )is-like-a 4.3.8.4 upcasting 4.3.9 encapsulation 47
1 48
1 5. Java Basic Grammar 5.1 Construct 5.2 abstract 49
1 5.3 Overriding 5.3.1 closure 5.3.2 call back 5.4 Overloading 50
5.5 Constructor 5.6 tostring() 5.7 Inner class 51
5.8 Wrapper Class 5.9 Local class 52
1 5.10 Anonymous class 53
5.11 Collection API 54
5.11.3 Collection interface 5.11.4 Set interface 55
5.11.5 List / ListIterator interface 5.11.6 Map interface 56
5.12 Reflection API 5.13 Vector 5.14 Heterogeneous Collections 57
5.15 Exception 58
1 59
1 5.16 Handle or Declare 60
1 5.17 static inner class 61
1 5.18 finally 62