The first chapter Java Programming Fundamentals (say 30)
03 | development environment to build (macOS)
04 | HelloWorld program compile and run (macOS)
05 | development environment to build (Windows)
06 | HelloWorld program compile and run (Windows)
07 | Detailed HelloWorld program
08 | install and use IntelliJ IDEA integrated development environment (macOS)
09 | install and use IntelliJ IDEA integrated development environment (Windows)
10 | from addition and subtraction to multiplication and division variable
11 | Revisited program calculates the Math
15 | more basic data types of grammar
16 | character set encoding and strings
. 17 | operators and data types are summarized
18 | execution flow of the program if-else statement (on)
19 | execution flow of the program if-else statement (under)
20 | program loop of the for statement
21 | code blocks and scope of variables
22 | while the program loop statements
23 | execution flow of the program switch statement
24 | cycle and summary judgment (on)
25 | cycle and summary judgment (under)
26 | save with an array of achievements
27 | understanding of variables and arrays (on)
28 | understanding variables and arrays (lower)
30 | flexible handler with an array
The second chapter Java object-oriented programming (say 74)
32 | On the classes and objects
33 | understanding reference type (a)
34 | recognize a reference type (under)
35 | classes, objects and references relationship
37 | The default value is null reference
38 | like to use the same custom type class
39 | Java package and access modifier (a)
40 | Java package and access modifier (lower)
41 | to build a small supermarket
43 | Method: Let the Merchandise object has behavior
44 | Returns: Let Merchandise gross profit calculation
45 | argument: Let Merchandise calculate the total price of multiple items
46 | how parameters and return values are passed
47 | distinguish parameters, local variables and instance site
48 | hide this self-referential
49 | understood that the method: a special code blocks
50 | calls the method of understanding: a special code to jump
51 | to add Java classes and methods Notes
52 | Object mature class to do things their own
53 | method signatures and overloading
54 | overloaded parameter matching rules
55 | constructor: Method configuration example
Overloading and call each other constructor | 56
60 | static and static variables initialization block
61 | visibility modifiers methods and properties
62 | new understanding of an old friend: Math and Scanner (on)
63 | new understanding of an old friend: Math and Scanner (under)
64 | The most familiar stranger: String (on)
65 | The most familiar stranger: String (under)
66 | new understanding of an old friend: main Method and System class
68 | Inheritance: make it easier for goods to add new category
69 | subclass object hidden in a parent object
70 | covering: Want a little different subclasses
71 | super: the parent object and a bridge
72 | super: call the constructor of the parent class
73 | references assignment relationship of parent and child classes
74 | polymorphism: Which method call in the end? (on)
75 | polymorphism: Which method call in the end? (under)
76 | polymorphism in more grammar (on)
77 | polymorphism in more grammar points (down)
79 | inherit exclusive access control: protected
82 | inherit in the static method
83 | episode: for another cycle of writing
84 | million class ancestor: Object class
85 | hashCode and equals method (on)
86 | hashCode and equals method (under)
90 | On the reflection (lower)
91 | object-oriented three elements: encapsulation, inheritance and polymorphism
92 | enumerate: the definition of categories of goods
93 | Interface: Let types of goods more abundant (on)
94 | Interface: make commodity type richer (lower)
95 | abstract class: a mix of interfaces and classes
96 | there are ways the interface code
97 | more content within the interface code
99 | members of the inner class
103 | Let's supermarket up and running: design articles
104 | Let's supermarket up and running: Code articles
The third chapter in the Java exception handling (9 say)
105 | acquaintance anomaly: try catch
106 | Java exception classification
108 | passed the Java exception
110 | abnormal transfer is not Lingboweibu
111 | try catch finally statement
112 | automatic recovery resources try statement
113 | common exceptions in Java
Chapter IV of common tools like Java and new syntax (Lecture 22)
114 | Collection Introduction to Group
116 | Collection of List (lower)
122 | Map: key and value mapping
124 | Lambda VS anonymous class (on)
125 | Lambda VS anonymous classes (under)
126 | basic types of automatic boxing and unboxing
129 | write the contents of a file applet
130 | read the contents of the file applet
131 | Network Communication nouns Profile
132 | Simple Network communication applet (on)
133 | Simple Network communication applet (under)
134 | Simple crawls the web program
The fifth chapter in Java threads (say 19)
139 | Multithreading: chaos began
140 | synchronous control of synchronized
141 | synchronous control of wait notify
142 | multithreading classic model: producers and consumers
143 | thread synchronization of join
145 | ThreadLocal thread-specific variables
147 | role of the volatile keyword
Forced to retrieve data from memory
public class AccessMemoryVolatile {
public volatile long counterV = 0;
public long counter = 0;
public static void main(String[] args) {
int loopCount = Integer.MAX_VALUE / 30;
// TODO 只是为了演示 volatile 每次访问都要直达内存,不能使用缓存,所以耗费的时间略多
AccessMemoryVolatile accessMemoryVolatile = new AccessMemoryVolatile();
Thread volatileAdder = new Thread(() -> {
long start = System.currentTimeMillis();
for (int i = 0; i < loopCount; i++) {
accessMemoryVolatile.counterV++;
}
System.out.println("volatile adder takes " + (System.currentTimeMillis() - start));
});
volatileAdder.start();
Thread justAdder = new Thread(() -> {
long start = System.currentTimeMillis();
for (int i = 0; i < loopCount; i++) {
accessMemoryVolatile.counter++;
}
System.out.println("simple adder takes " + (System.currentTimeMillis() - start));
});
justAdder.start();
}
}
Instruction that affects the rearrangement
package com.geekbang.learnvolatile;
public class VolatileAppMain {
public static void main(String[] args) {
DataHolder dataHolder = new DataHolder();
Thread operator = new Thread(() -> {
while (true) {
dataHolder.operateData();
}
});
operator.start();
Thread checker = new Thread(() -> {
while (true) {
dataHolder.check();
}
});
checker.start();
}
}
148 | concurrent package rationale
149 | concurrent Atomic package to Group
151 | concurrent packet data structure
152 | concurrent thread pool package
153 | chat room opened myself (on)
154 | chat room opened myself (under)
Chapter VI Java programming combat (say 16)
155 | What is learning a language
157 | Maven concept Introduction
158 | Maven installation and configuration
159 | create a simple Maven project
160 | a text drawn from pptx file gadget
161 | Maven frequently used commands and plug-ins
163 | worth learning library Introduction
164 | how to ask questions will not be scolded on Stack Overflow
166 | small game program features defined
167 | small game programming and module division
168 | game applet code analysis