Showing preview only (573K chars total). Download the full file or copy to clipboard to get everything.
Repository: MarkShen1992/Mashibing_High_Concurrency
Branch: master
Commit: 1ba32218761e
Files: 335
Total size: 58.9 MB
Directory structure:
gitextract__3rwbfmy/
├── .editorconfig
├── .gitignore
├── .mvn/
│ ├── jvm.config
│ └── wrapper/
│ └── maven-wrapper.properties
├── .travis.yml
├── README.md
├── concurrency.md
├── jvm/
│ └── jvm8 all parameters.txt
├── mvnw
├── mvnw.cmd
├── pom.xml
├── src/
│ ├── main/
│ │ └── java/
│ │ └── com/
│ │ ├── annotation/
│ │ │ ├── README.md
│ │ │ ├── jdk/
│ │ │ │ ├── Child.java
│ │ │ │ ├── ParseAnnotation.java
│ │ │ │ ├── Person.java
│ │ │ │ └── Test.java
│ │ │ ├── own/
│ │ │ │ └── Description.java
│ │ │ └── project/
│ │ │ ├── Column.java
│ │ │ ├── Department.java
│ │ │ ├── Table.java
│ │ │ ├── Test.java
│ │ │ └── User.java
│ │ ├── art/
│ │ │ └── concurrency/
│ │ │ ├── ch01/
│ │ │ │ ├── ConcurrencyTest.java
│ │ │ │ └── DeadLockDemo.java
│ │ │ ├── ch04/
│ │ │ │ ├── Daemon.java
│ │ │ │ ├── Deprecated.java
│ │ │ │ ├── Interrupted.java
│ │ │ │ ├── MultiThread.java
│ │ │ │ ├── Priority.java
│ │ │ │ ├── Shutdown.java
│ │ │ │ └── ThreadState.java
│ │ │ ├── ch08/
│ │ │ │ ├── BankWaterService.java
│ │ │ │ ├── CountDownLatchTest.java
│ │ │ │ ├── CyclicBarrierTest.java
│ │ │ │ ├── CyclicBarrierTest02.java
│ │ │ │ ├── CyclicBarrierTest03.java
│ │ │ │ ├── ExchangerTest.java
│ │ │ │ └── SemaphoreTest.java
│ │ │ └── utils/
│ │ │ └── SleepUtils.java
│ │ ├── basic/
│ │ │ ├── alibaba/
│ │ │ │ ├── BigDecimalTest.java
│ │ │ │ ├── CollectionTest.java
│ │ │ │ ├── ConfusingName.java
│ │ │ │ ├── DateTest.java
│ │ │ │ ├── FloatPrimitiveTest.java
│ │ │ │ ├── FloatWrapTest.java
│ │ │ │ ├── IntegerCacheTest.java
│ │ │ │ ├── LockTest.java
│ │ │ │ ├── PrimitiveTypeArrayMaxSizeTest.java
│ │ │ │ ├── SwitchTest.java
│ │ │ │ └── package-info.java
│ │ │ ├── chapter0100/
│ │ │ │ ├── Chapter0100Introduction.java
│ │ │ │ ├── Chapter0101Identifier.java
│ │ │ │ ├── Chapter0102JavaKeyWord.java
│ │ │ │ ├── Chapter0103ConstantAndVariable.java
│ │ │ │ ├── Chapter0104TestVar.java
│ │ │ │ ├── Chapter0104TestVar2.java
│ │ │ │ ├── Chapter0104VariableType.java
│ │ │ │ ├── Chapter0105DataType.java
│ │ │ │ ├── Chapter0106BasicDataTypeConvertPrinciple.java
│ │ │ │ ├── Chapter0106TestConvert.java
│ │ │ │ ├── Chapter0106TestConvert2.java
│ │ │ │ ├── Chapter0107TestIF.java
│ │ │ │ ├── Chapter0108For.java
│ │ │ │ ├── Chapter0109TestWhile.java
│ │ │ │ ├── Chapter0110TestBreakAndContinue.java
│ │ │ │ ├── Chapter0111TestSwitch.java
│ │ │ │ ├── Chapter0112TestMethod.java
│ │ │ │ ├── Chapter0113TestMethod2.java
│ │ │ │ ├── Chapter0114Fab.java
│ │ │ │ ├── Test01.java
│ │ │ │ └── Test02.java
│ │ │ ├── chapter0200/
│ │ │ │ ├── Chapter0200Introduction.java
│ │ │ │ ├── Chapter0201OO.java
│ │ │ │ ├── Chapter0202ValueTransferAndReferenceTransfer.java
│ │ │ │ ├── Chapter0203Point.java
│ │ │ │ ├── Chapter0204MethodOverload.java
│ │ │ │ ├── Chapter0205TestOverLoad.java
│ │ │ │ ├── Chapter0206TestCircle.java
│ │ │ │ ├── Chapter0207this.java
│ │ │ │ ├── Chapter0208static.java
│ │ │ │ ├── Chapter0209TestInherit.java
│ │ │ │ ├── Chapter0210TestEquals.java
│ │ │ │ ├── Chapter0211TestFinal.java
│ │ │ │ ├── Chapter0212TestInterface.java
│ │ │ │ ├── Chapter0213DoubleBraceInitializationModel.java
│ │ │ │ ├── MessageFormatTest.java
│ │ │ │ └── TestSuperSub.java
│ │ │ ├── chapter0300/
│ │ │ │ ├── Chapter0300ExceptionIntroduction.java
│ │ │ │ ├── Chapter0301TestEx.java
│ │ │ │ ├── Chapter0302MethodException.java
│ │ │ │ └── Chapter0303Junk.java
│ │ │ ├── chapter0400/
│ │ │ │ ├── Chapter0401ArrayIntroduction.java
│ │ │ │ ├── Chapter0402TestArgs.java
│ │ │ │ ├── Chapter0403SortAlgorithm.java
│ │ │ │ ├── Chapter0404TestDateSort.java
│ │ │ │ ├── Chapter0405TestSearch.java
│ │ │ │ ├── Chapter0406TestArrayCopy.java
│ │ │ │ ├── Count3Quit.java
│ │ │ │ └── Count3Quit2.java
│ │ │ ├── chapter0500/
│ │ │ │ ├── Chapter0501CommonUseClass.java
│ │ │ │ ├── Chapter0502TestString2.java
│ │ │ │ ├── Chapter0503TestString3.java
│ │ │ │ ├── Chapter0504TestString.java
│ │ │ │ ├── Chapter0505StringBuffer.java
│ │ │ │ ├── Chapter0506BasicTypeWrap.java
│ │ │ │ ├── Chapter0507ArrayParser.java
│ │ │ │ ├── Chapter0508TestMath.java
│ │ │ │ ├── Chapter0509TestFile.java
│ │ │ │ ├── Chapter0510FileList.java
│ │ │ │ └── Chapter0511TestEnum.java
│ │ │ ├── chapter0600/
│ │ │ │ ├── BasicContainer.java
│ │ │ │ ├── BasicGeneric.java
│ │ │ │ ├── CollectionsTest.java
│ │ │ │ ├── DataStructureSelection.java
│ │ │ │ ├── EnhancedFor.java
│ │ │ │ ├── IteratorTest.java
│ │ │ │ ├── SetTest.java
│ │ │ │ ├── TestArgsWords.java
│ │ │ │ ├── TestArgsWords2.java
│ │ │ │ ├── TestMap.java
│ │ │ │ └── TestMap2.java
│ │ │ ├── chapter0700/
│ │ │ │ ├── FileCopy.java
│ │ │ │ ├── HelloWorld.java
│ │ │ │ ├── TestBufferStream1.java
│ │ │ │ ├── TestBufferStream2.java
│ │ │ │ ├── TestDataStream.java
│ │ │ │ ├── TestFileInputStream.java
│ │ │ │ ├── TestFileOutputStream.java
│ │ │ │ ├── TestFileReader.java
│ │ │ │ ├── TestFileWriter.java
│ │ │ │ ├── TestFileWriter2.java
│ │ │ │ ├── TestObjectIO.java
│ │ │ │ ├── TestPrintStream1.java
│ │ │ │ ├── TestPrintStream2.java
│ │ │ │ ├── TestPrintStream3.java
│ │ │ │ ├── TestTransForm1.java
│ │ │ │ ├── TestTransForm2.java
│ │ │ │ └── TreeDir.java
│ │ │ ├── chapter0800/
│ │ │ │ ├── 111.txt
│ │ │ │ ├── ProducerConsumer.java
│ │ │ │ ├── ProducerConsumer2.java
│ │ │ │ ├── RecursiveFile.java
│ │ │ │ ├── T.java
│ │ │ │ ├── TT.java
│ │ │ │ ├── Test.java
│ │ │ │ ├── TestDeadLock.java
│ │ │ │ ├── TestInterrupt.java
│ │ │ │ ├── TestJoin.java
│ │ │ │ ├── TestPriority.java
│ │ │ │ ├── TestSync.java
│ │ │ │ ├── TestThread1.java
│ │ │ │ ├── TestThread2.java
│ │ │ │ ├── TestThread3.java
│ │ │ │ ├── TestThread4.java
│ │ │ │ ├── TestThread5.java
│ │ │ │ ├── TestThread6.java
│ │ │ │ └── TestYield.java
│ │ │ ├── chapter0900/
│ │ │ │ ├── Chapter0901TestUDPClient.java
│ │ │ │ ├── Chapter0901TestUDPServer.java
│ │ │ │ ├── Chat/
│ │ │ │ │ ├── Chat03/
│ │ │ │ │ │ ├── ChatClient.java
│ │ │ │ │ │ └── ChatServer.java
│ │ │ │ │ ├── Chat05/
│ │ │ │ │ │ ├── ChatClient.java
│ │ │ │ │ │ └── ChatServer.java
│ │ │ │ │ ├── Chat07/
│ │ │ │ │ │ ├── ChatClient.java
│ │ │ │ │ │ └── ChatServer.java
│ │ │ │ │ └── Chat10/
│ │ │ │ │ ├── ChatClient.java
│ │ │ │ │ └── ChatServer.java
│ │ │ │ ├── TCPClient.java
│ │ │ │ ├── TCPServer.java
│ │ │ │ ├── TalkClient.java
│ │ │ │ ├── TalkServer.java
│ │ │ │ ├── TestClient.java
│ │ │ │ ├── TestServer.java
│ │ │ │ ├── TestSockClient.java
│ │ │ │ ├── TestSockServer.java
│ │ │ │ ├── TestUDPClient.java
│ │ │ │ ├── TestUDPServer.java
│ │ │ │ └── zerocopy/
│ │ │ │ ├── traditonal/
│ │ │ │ │ ├── TraditionalClient.java
│ │ │ │ │ └── TraditionalServer.java
│ │ │ │ └── transfer/
│ │ │ │ ├── TransferToClient.java
│ │ │ │ └── TransferToServer.java
│ │ │ ├── chapter1000/
│ │ │ │ ├── AWTDrawing.java
│ │ │ │ ├── AWTDrawing2.java
│ │ │ │ ├── CenterPanel.java
│ │ │ │ ├── MyMouseAdapter.java
│ │ │ │ ├── MyMouseAdapterGeneric.java
│ │ │ │ ├── NestedContainer.java
│ │ │ │ ├── TFActionEvent.java
│ │ │ │ ├── TFMath.java
│ │ │ │ ├── TFMathTest.java
│ │ │ │ ├── TFMathTest2.java
│ │ │ │ ├── TFPassword.java
│ │ │ │ ├── TenButtons.java
│ │ │ │ ├── Test.java
│ │ │ │ ├── TestActionEvent.java
│ │ │ │ ├── TestActionEvent2.java
│ │ │ │ ├── TestAnonymous.java
│ │ │ │ ├── TestAnonymous2.java
│ │ │ │ ├── TestBorderLayout.java
│ │ │ │ ├── TestFlowLayout.java
│ │ │ │ ├── TestFlowLayout2.java
│ │ │ │ ├── TestFrame.java
│ │ │ │ ├── TestFrameWithPanel.java
│ │ │ │ ├── TestGridLayout.java
│ │ │ │ ├── TestInner.java
│ │ │ │ ├── TestKey.java
│ │ │ │ ├── TestMouseMotion.java
│ │ │ │ ├── TestMouseMotionGeneric.java
│ │ │ │ ├── TestMultiFrame.java
│ │ │ │ ├── TestMultiPanel.java
│ │ │ │ ├── TestPaint.java
│ │ │ │ ├── TestPanel.java
│ │ │ │ └── TestWindowClose.java
│ │ │ ├── chapter1100/
│ │ │ │ └── TestReflect.java
│ │ │ └── chapter1200/
│ │ │ ├── QQClient.java
│ │ │ └── QQServer.java
│ │ ├── geo/
│ │ │ ├── GeoLite2-City.mmdb
│ │ │ └── GeoTest.java
│ │ ├── java10/
│ │ │ └── NewFeatures.java
│ │ ├── java11/
│ │ │ └── NewFeatures.java
│ │ ├── java12/
│ │ │ └── NewFeatures.java
│ │ ├── java13/
│ │ │ └── NewFeatures.java
│ │ ├── java14/
│ │ │ └── Java14NewFeatures.java
│ │ ├── java15/
│ │ │ └── NewFeatures.java
│ │ ├── java16/
│ │ │ └── Java16NewFeatures.java
│ │ ├── java17/
│ │ │ └── Java17NewFeatures.java
│ │ ├── java18/
│ │ │ └── Java18Features.java
│ │ ├── java19/
│ │ │ └── Java19Features.java
│ │ ├── java5/
│ │ │ └── NewFeatures.java
│ │ ├── java6/
│ │ │ └── NewFeatures.java
│ │ ├── java7/
│ │ │ └── NewFeatures.java
│ │ ├── java8/
│ │ │ ├── Demo0100_LambdaRunnable.java
│ │ │ ├── Demo0200_LambdaIterator.java
│ │ │ ├── Demo0300_LambdaPredicate.java
│ │ │ ├── Demo0400_LambdaMapReduce.java
│ │ │ ├── Demo0500_LambdaSimpleDemo.java
│ │ │ ├── Demo0600_Stream.java
│ │ │ ├── Demo0700_Stream.java
│ │ │ ├── Demo0800_Stream.java
│ │ │ ├── NewFeatures.java
│ │ │ └── Person.java
│ │ ├── java9/
│ │ │ └── NewFeatures.java
│ │ ├── jvm/
│ │ │ └── OutOfMemoryException.java
│ │ ├── mark/
│ │ │ ├── concurrent01/
│ │ │ │ └── T.java
│ │ │ ├── concurrent02/
│ │ │ │ ├── T.java
│ │ │ │ └── T2.java
│ │ │ ├── concurrent03/
│ │ │ │ └── T.java
│ │ │ ├── concurrent04/
│ │ │ │ └── T.java
│ │ │ ├── concurrent05/
│ │ │ │ └── T.java
│ │ │ ├── concurrent06/
│ │ │ │ ├── T.java
│ │ │ │ └── T2.java
│ │ │ ├── concurrent07/
│ │ │ │ └── T.java
│ │ │ ├── concurrent08/
│ │ │ │ └── Account.java
│ │ │ ├── concurrent09/
│ │ │ │ └── T.java
│ │ │ ├── concurrent10/
│ │ │ │ └── T.java
│ │ │ ├── concurrent11/
│ │ │ │ └── T.java
│ │ │ ├── concurrent12/
│ │ │ │ └── T.java
│ │ │ ├── concurrent13/
│ │ │ │ └── T.java
│ │ │ ├── concurrent14/
│ │ │ │ └── T.java
│ │ │ ├── concurrent15/
│ │ │ │ └── T.java
│ │ │ ├── concurrent16/
│ │ │ │ └── T.java
│ │ │ ├── concurrent17/
│ │ │ │ └── T.java
│ │ │ ├── concurrent18/
│ │ │ │ └── T.java
│ │ │ ├── concurrent19/
│ │ │ │ ├── MyContainer1.java
│ │ │ │ ├── MyContainer2.java
│ │ │ │ ├── MyContainer3.java
│ │ │ │ ├── MyContainer4.java
│ │ │ │ └── MyContainer5.java
│ │ │ ├── concurrent20/
│ │ │ │ ├── ReentrantLock1.java
│ │ │ │ ├── ReentrantLock2.java
│ │ │ │ ├── ReentrantLock3.java
│ │ │ │ ├── ReentrantLock4.java
│ │ │ │ └── ReentrantLock5.java
│ │ │ ├── concurrent21/
│ │ │ │ ├── MyContainer1.java
│ │ │ │ └── MyContainer2.java
│ │ │ ├── concurrent22/
│ │ │ │ ├── ThreadLocal1.java
│ │ │ │ └── ThreadLocal2.java
│ │ │ ├── concurrent23/
│ │ │ │ └── Singleton.java
│ │ │ ├── concurrent24/
│ │ │ │ ├── TicketSeller1.java
│ │ │ │ ├── TicketSeller2.java
│ │ │ │ ├── TicketSeller3.java
│ │ │ │ └── TicketSeller4.java
│ │ │ ├── concurrent25/
│ │ │ │ ├── T01_ConcurrentMap.java
│ │ │ │ ├── T02_CopyOnWriteList.java
│ │ │ │ ├── T03_SynchronizedList.java
│ │ │ │ ├── T04_ConcurrentQueue.java
│ │ │ │ ├── T05_LinkedBlockingQueue.java
│ │ │ │ ├── T06_ArrayBlockingQueue.java
│ │ │ │ ├── T07_DelayQueue.java
│ │ │ │ ├── T08_TransferQueue.java
│ │ │ │ └── T09_SynchronousQueue.java
│ │ │ ├── concurrent26/
│ │ │ │ ├── T01_MyExecutor.java
│ │ │ │ ├── T02_ExecutorService.java
│ │ │ │ ├── T03_Callable.java
│ │ │ │ ├── T04_Executors.java
│ │ │ │ ├── T05_ThreadPool.java
│ │ │ │ ├── T06_Future.java
│ │ │ │ ├── T07_ParallelComputing.java
│ │ │ │ ├── T08_CachedThreadPool.java
│ │ │ │ ├── T09_SingleThreadPool.java
│ │ │ │ ├── T10_ScheduleThreadPool.java
│ │ │ │ ├── T11_WorkStealingPool.java
│ │ │ │ ├── T12_ForkJoinPool.java
│ │ │ │ ├── T13_ThreadPoolExecutor.java
│ │ │ │ ├── T14_ParallelStreamAPI.java
│ │ │ │ ├── T15_SelfDefinitionThreadPool.java
│ │ │ │ └── readme.txt
│ │ │ └── note/
│ │ │ └── question.md
│ │ ├── mmap/
│ │ │ ├── MemoryBufferTest.java
│ │ │ └── MmapWriteReadTest.java
│ │ ├── program/
│ │ │ ├── CodeGenerator.java
│ │ │ ├── CollectionIterate.java
│ │ │ ├── ConstructTree.java
│ │ │ ├── FizzBuzzDemo.java
│ │ │ ├── ULIDTest.java
│ │ │ └── WechatCircleLikeDisplay.java
│ │ ├── snake/
│ │ │ ├── Direction.java
│ │ │ ├── Egg.java
│ │ │ ├── Node.java
│ │ │ ├── Snake.java
│ │ │ └── Yard.java
│ │ └── thread/
│ │ ├── AnimalBehavior.java
│ │ ├── Cat.java
│ │ ├── CatMain.java
│ │ ├── MyRunnable.java
│ │ ├── MyRunnableTest.java
│ │ ├── NotifySpecifiedThread.java
│ │ ├── T.java
│ │ └── T01_TestJoin.java
│ └── test/
│ └── java/
│ └── com/
│ ├── java8/
│ │ └── NewFeatureTest.java
│ └── mark/
│ └── concurrent01/
│ └── TTest.java
├── style/
│ ├── STYLE.md
│ └── codestyle/
│ ├── eclipse/
│ │ └── codestyle.xml
│ └── idea/
│ └── codestyle.xml
└── test/
└── test.txt
================================================
FILE CONTENTS
================================================
================================================
FILE: .editorconfig
================================================
root = true
[*.{groovy, java, kt, xml}]
#缩进风格:空格
indent_style = space
#缩进大小
indent_size = 4
#换行符lf
end_of_line = lf
#字符集utf-8
charset = utf-8
#是否删除行尾的空格
trim_trailing_whitespace = true
#是否在文件的最后插入一个空行
insert_final_newline = true
================================================
FILE: .gitignore
================================================
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
# Eclipse project files
.classpath
.project
.settings
.settings/
target/
# IDEA metadata and output dirs
*.iml
*.ipr
*.iws
.idea/
# gitbook
_book
tmp
.springBeans
================================================
FILE: .mvn/jvm.config
================================================
-Xmx1536m
================================================
FILE: .mvn/wrapper/maven-wrapper.properties
================================================
distributionUrl=https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.3/maven-wrapper-0.5.3.jar
================================================
FILE: .travis.yml
================================================
language: java
jdk: openjdk8
cache:
directories:
- $HOME/.m2
before_install:
- chmod +x mvnw
install:
- ./mvnw install -B -V -Dmaven.test.skip=true
================================================
FILE: README.md
================================================
### 小统计:

> **Don't count the days, make each day count.**
### 代码目录
- Chapter00_初识Java
- Hello World
- 初步认识
- 代码风格
- [谷歌代码风格](https://google.github.io/styleguide)
- [阿里代码风格](https://github.com/alibaba/p3c)
- [Chapter01_Java语言基础](https://github.com/MarkShen1992/Mashibing_High_Concurrency/tree/master/src/main/java/com/basic/chapter0100)
- **关键字**:if, else, switch, for, while, do while, break, continue, void
- 变量作用域:**出了这个大括号就再也没有人认识这个变量了。**
- 基本数据类型:**四类八种**
- 整数类型:byte(1 byte), short(2 bytes), int(4 bytes), long(8 bytes)
- 浮点类型:float(4 bytes), double(8 bytes)
- 字符类型:char(2 bytes)
- 布尔类型:boolean
> Instead, expressions in the Java programming language that operate on boolean values are compiled to use values of the Java Virtual Machine **int** data type.
>
> -- [*JVMS8*](https://github.com/MarkShen1992/bookstore/tree/master/java/Java%20Virtual%20Machine/jvm8)
```java
boolean flag = false;
```
>In Oracle’s Java Virtual Machine implementation, boolean arrays in the Java programming language are encoded as Java Virtual Machine byte arrays, using 8 bits per boolean element.
>
> -- [*JVMS8*](https://github.com/MarkShen1992/bookstore/tree/master/java/Java%20Virtual%20Machine/jvm8)
```java
boolean[] flags = {false, true, false, true, true};
```
- 形参,实参,返回值,返回值类型
- 递归调用
- [**Chapter02_面向对象编程**](https://github.com/MarkShen1992/Mashibing_High_Concurrency/tree/master/src/main/java/com/basic/chapter0200)
- **内存分析贯穿始终,画图分析**
- 对象与类的概念
- **面向对象设计思想**
- 第一步:考虑问题域中有哪些类,哪些对象
- 第二步:这些个类,这些个对象有哪些个属性
- 第三步:考虑类与类之间的关系,定他们之间的方法
- class
- new
- 引用的概念
- 构造方法的概念
- 方法重载(编译时多态)
- 参数个数
- 参数类型
- 参数顺序
- this
- super
- static
- package & import
- private default protected public
- extends
- override
- final
- Object
- equals
- toString
- upcasting downcasting
- polymorphism / dynamic binding / late
- 有继承关系存在
- 存在方法重写 @Override
- 父类引用指向子类对象
- abstract class
- interface
- implements
- [Chapter03_Java异常处理机制](https://github.com/MarkShen1992/Mashibing_High_Concurrency/tree/master/src/main/java/com/basic/chapter0300)
- 一个图

- 五个关键字
- try, catch, finally, throw, throws
- 异常捕获原则
- 先逮小的,再逮大的
- 异常和重写的关系: **重写方法需要抛出与原方法所抛出异常类型一致的异常 或者 不抛出异常**
- [Chapter04_数组](https://github.com/MarkShen1992/Mashibing_High_Concurrency/tree/master/src/main/java/com/basic/chapter0400)
- 数组的内存布局
- 常见算法
- [Chapter05_Java常用类](https://github.com/MarkShen1992/Mashibing_High_Concurrency/tree/master/src/main/java/com/basic/chapter0500)
- 正则表达式
- 基础类型包装类
- Math
- File
- 递归
- 枚举类型
- [**Chapter06_容器类**](https://github.com/MarkShen1992/Mashibing_High_Concurrency/tree/master/src/main/java/com/basic/chapter0600)
- 一个图

- 一个类
- Collections
- 三个知识点
- For
- Generic
- Auto-boxing / unboxing
- 六个接口
- Collection
- Set
- List
- Map
- Iterator
- Comparable
- [**Chapter07_IO流技术**](https://github.com/MarkShen1992/Mashibing_High_Concurrency/tree/master/src/main/java/com/basic/chapter0700)

- InputStream / OutputStream
- Reader / Writer
- FileInputStream / FileOutputStream
- FileReader / FileWriter
- BufferedInputStream / BufferedOutputStream
- BufferedReader / BufferedWriter
- ByteArrayInputStream / ByteArrayOutputStream
- InputStreamReader / OutputStreamWriter
- DataInputStream / DataOutputStream
- PrintStream / PrintWriter
- ObjectInputStream / ObjectOutputStream
- 分类
- 方向:输入流,输出流
- 数据处理单位:字节流,字符流
- 功能:节点流,处理流
- [**Chapter08_多线程**](https://github.com/MarkShen1992/Mashibing_High_Concurrency/tree/master/src/main/java/com/basic/chapter0800)
- 线程/进程/协程
- 创建启动线程的方式
- sleep, join, yield, synchronized, wait, notify, notifyAll
- [Chapter09_网络编程](https://github.com/MarkShen1992/Mashibing_High_Concurrency/tree/master/src/main/java/com/basic/chapter0900)
- 网络协议分层思想
- IP概念
- TCP / UDP概念
- TCP / UDP程序的写法
- 知识点融会贯通,+ io 应用
- [Chapter10_GUI](https://github.com/MarkShen1992/Mashibing_High_Concurrency/tree/master/src/main/java/com/basic/chapter1000)
- 事件模型,**观察者模式**
- [设计模式的代码](https://github.com/MarkShen1992/DesignPattern), 使用MyEclipse打开更好,有图可以看
- [Chapter11_反射](https://github.com/MarkShen1992/Mashibing_High_Concurrency/tree/master/src/main/java/com/basic/chapter1100)
- [**Chapter12_并发包类讲解代码**](https://github.com/MarkShen1992/Mashibing_High_Concurrency/tree/master/src/main/java/com/mark)
- [第一讲 concurrent1-19](https://v.qq.com/x/page/x052229kmeq.html)
- [第二讲 concurrent20-22](https://v.qq.com/x/page/f05224z6ul9.html)
- [第三讲 concurrent23-25](https://v.qq.com/x/page/z0522fzc1q3.html)
- [第四讲 concurrent26](https://v.qq.com/x/page/u0522rgqjyk.html)
- 高并发编程三大块:
- 同步器(synchronizer)
- 同步容器
- 线程池
- Executor
- Future
- Callable
- 框架
- [disruptor](https://github.com/LMAX-Exchange/disruptor)
- [netty](https://netty.io/)
- [Chapter13_利用反射做的小项目](https://github.com/MarkShen1992/Mashibing_High_Concurrency/tree/master/src/main/java/com/annotation)
- 常用工具代码
- [树形结构遍历](https://github.com/MarkShen1992/Mashibing_High_Concurrency/blob/master/src/main/java/com/program/ConstructTree.java)
- [Code生成](https://github.com/MarkShen1992/Mashibing_High_Concurrency/blob/master/src/main/java/com/program/CodeGenerator.java)
如果你喜欢这个项目,请我喝杯咖啡吧。
<img src="./like.jpg" alt="drawing" width="300" style="float: left;"/>
================================================
FILE: concurrency.md
================================================
# 马士兵高并发编程视频教程源码。
### 线程池类图

### 计算机体系结构







计算机硬件知识
<https://www.phy.ornl.gov/csep/ca/ca.html>
================================================
FILE: jvm/jvm8 all parameters.txt
================================================
java -XX:+PrintFlagsFinal -version
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)
JVM 参数学习网站
https://segmentfault.com/a/1190000040803727
https://opts.console.heapdump.cn/
[Global flags]
uintx AdaptiveSizeDecrementScaleFactor = 4 {product}
uintx AdaptiveSizeMajorGCDecayTimeScale = 10 {product}
uintx AdaptiveSizePausePolicy = 0 {product}
uintx AdaptiveSizePolicyCollectionCostMargin = 50 {product}
uintx AdaptiveSizePolicyInitializingSteps = 20 {product}
uintx AdaptiveSizePolicyOutputInterval = 0 {product}
uintx AdaptiveSizePolicyWeight = 10 {product}
uintx AdaptiveSizeThroughPutPolicy = 0 {product}
uintx AdaptiveTimeWeight = 25 {product}
bool AdjustConcurrency = false {product}
bool AggressiveOpts = false {product}
intx AliasLevel = 3 {C2 product}
bool AlignVector = true {C2 product}
intx AllocateInstancePrefetchLines = 1 {product}
intx AllocatePrefetchDistance = 256 {product}
intx AllocatePrefetchInstr = 0 {product}
intx AllocatePrefetchLines = 3 {product}
intx AllocatePrefetchStepSize = 64 {product}
intx AllocatePrefetchStyle = 1 {product}
bool AllowJNIEnvProxy = false {product}
bool AllowNonVirtualCalls = false {product}
bool AllowParallelDefineClass = false {product}
bool AllowUserSignalHandlers = false {product}
bool AlwaysActAsServerClassMachine = false {product}
bool AlwaysCompileLoopMethods = false {product}
bool AlwaysLockClassLoader = false {product}
bool AlwaysPreTouch = false {product}
bool AlwaysRestoreFPU = false {product}
bool AlwaysTenure = false {product}
bool AssertOnSuspendWaitFailure = false {product}
bool AssumeMP = false {product}
intx AutoBoxCacheMax = 128 {C2 product}
uintx AutoGCSelectPauseMillis = 5000 {product}
intx BCEATraceLevel = 0 {product}
intx BackEdgeThreshold = 100000 {pd product}
bool BackgroundCompilation = true {pd product}
uintx BaseFootPrintEstimate = 268435456 {product}
intx BiasedLockingBulkRebiasThreshold = 20 {product}
intx BiasedLockingBulkRevokeThreshold = 40 {product}
intx BiasedLockingDecayTime = 25000 {product}
intx BiasedLockingStartupDelay = 4000 {product}
bool BindGCTaskThreadsToCPUs = false {product}
bool BlockLayoutByFrequency = true {C2 product}
intx BlockLayoutMinDiamondPercentage = 20 {C2 product}
bool BlockLayoutRotateLoops = true {C2 product}
bool BranchOnRegister = false {C2 product}
bool BytecodeVerificationLocal = false {product}
bool BytecodeVerificationRemote = true {product}
bool C1OptimizeVirtualCallProfiling = true {C1 product}
bool C1ProfileBranches = true {C1 product}
bool C1ProfileCalls = true {C1 product}
bool C1ProfileCheckcasts = true {C1 product}
bool C1ProfileInlinedCalls = true {C1 product}
bool C1ProfileVirtualCalls = true {C1 product}
bool C1UpdateMethodData = true {C1 product}
intx CICompilerCount := 4 {product}
bool CICompilerCountPerCPU = true {product}
bool CITime = false {product}
bool CMSAbortSemantics = false {product}
uintx CMSAbortablePrecleanMinWorkPerIteration = 100 {product}
intx CMSAbortablePrecleanWaitMillis = 100 {manageable}
uintx CMSBitMapYieldQuantum = 10485760 {product}
uintx CMSBootstrapOccupancy = 50 {product}
bool CMSClassUnloadingEnabled = true {product}
uintx CMSClassUnloadingMaxInterval = 0 {product}
bool CMSCleanOnEnter = true {product}
bool CMSCompactWhenClearAllSoftRefs = true {product}
uintx CMSConcMarkMultiple = 32 {product}
bool CMSConcurrentMTEnabled = true {product}
uintx CMSCoordinatorYieldSleepCount = 10 {product}
bool CMSDumpAtPromotionFailure = false {product}
bool CMSEdenChunksRecordAlways = true {product}
uintx CMSExpAvgFactor = 50 {product}
bool CMSExtrapolateSweep = false {product}
uintx CMSFullGCsBeforeCompaction = 0 {product}
uintx CMSIncrementalDutyCycle = 10 {product}
uintx CMSIncrementalDutyCycleMin = 0 {product}
bool CMSIncrementalMode = false {product}
uintx CMSIncrementalOffset = 0 {product}
bool CMSIncrementalPacing = true {product}
uintx CMSIncrementalSafetyFactor = 10 {product}
uintx CMSIndexedFreeListReplenish = 4 {product}
intx CMSInitiatingOccupancyFraction = -1 {product}
uintx CMSIsTooFullPercentage = 98 {product}
double CMSLargeCoalSurplusPercent = 0.950000 {product}
double CMSLargeSplitSurplusPercent = 1.000000 {product}
bool CMSLoopWarn = false {product}
uintx CMSMaxAbortablePrecleanLoops = 0 {product}
intx CMSMaxAbortablePrecleanTime = 5000 {product}
uintx CMSOldPLABMax = 1024 {product}
uintx CMSOldPLABMin = 16 {product}
uintx CMSOldPLABNumRefills = 4 {product}
uintx CMSOldPLABReactivityFactor = 2 {product}
bool CMSOldPLABResizeQuicker = false {product}
uintx CMSOldPLABToleranceFactor = 4 {product}
bool CMSPLABRecordAlways = true {product}
uintx CMSParPromoteBlocksToClaim = 16 {product}
bool CMSParallelInitialMarkEnabled = true {product}
bool CMSParallelRemarkEnabled = true {product}
bool CMSParallelSurvivorRemarkEnabled = true {product}
uintx CMSPrecleanDenominator = 3 {product}
uintx CMSPrecleanIter = 3 {product}
uintx CMSPrecleanNumerator = 2 {product}
bool CMSPrecleanRefLists1 = true {product}
bool CMSPrecleanRefLists2 = false {product}
bool CMSPrecleanSurvivors1 = false {product}
bool CMSPrecleanSurvivors2 = true {product}
uintx CMSPrecleanThreshold = 1000 {product}
bool CMSPrecleaningEnabled = true {product}
bool CMSPrintChunksInDump = false {product}
bool CMSPrintEdenSurvivorChunks = false {product}
bool CMSPrintObjectsInDump = false {product}
uintx CMSRemarkVerifyVariant = 1 {product}
bool CMSReplenishIntermediate = true {product}
uintx CMSRescanMultiple = 32 {product}
uintx CMSSamplingGrain = 16384 {product}
bool CMSScavengeBeforeRemark = false {product}
uintx CMSScheduleRemarkEdenPenetration = 50 {product}
uintx CMSScheduleRemarkEdenSizeThreshold = 2097152 {product}
uintx CMSScheduleRemarkSamplingRatio = 5 {product}
double CMSSmallCoalSurplusPercent = 1.050000 {product}
double CMSSmallSplitSurplusPercent = 1.100000 {product}
bool CMSSplitIndexedFreeListBlocks = true {product}
intx CMSTriggerInterval = -1 {manageable}
uintx CMSTriggerRatio = 80 {product}
intx CMSWaitDuration = 2000 {manageable}
uintx CMSWorkQueueDrainThreshold = 10 {product}
bool CMSYield = true {product}
uintx CMSYieldSleepCount = 0 {product}
uintx CMSYoungGenPerWorker = 67108864 {pd product}
uintx CMS_FLSPadding = 1 {product}
uintx CMS_FLSWeight = 75 {product}
uintx CMS_SweepPadding = 1 {product}
uintx CMS_SweepTimerThresholdMillis = 10 {product}
uintx CMS_SweepWeight = 75 {product}
bool CheckEndorsedAndExtDirs = false {product}
bool CheckJNICalls = false {product}
bool ClassUnloading = true {product}
bool ClassUnloadingWithConcurrentMark = true {product}
intx ClearFPUAtPark = 0 {product}
bool ClipInlining = true {product}
uintx CodeCacheExpansionSize = 65536 {pd product}
uintx CodeCacheMinimumFreeSpace = 512000 {product}
bool CollectGen0First = false {product}
bool CompactFields = true {product}
intx CompilationPolicyChoice = 3 {product}
ccstrlist CompileCommand = {product}
ccstr CompileCommandFile = {product}
ccstrlist CompileOnly = {product}
intx CompileThreshold = 10000 {pd product}
bool CompilerThreadHintNoPreempt = true {product}
intx CompilerThreadPriority = -1 {product}
intx CompilerThreadStackSize = 0 {pd product}
uintx CompressedClassSpaceSize = 1073741824 {product}
uintx ConcGCThreads = 0 {product}
intx ConditionalMoveLimit = 3 {C2 pd product}
intx ContendedPaddingWidth = 128 {product}
bool ConvertSleepToYield = true {pd product}
bool ConvertYieldToSleep = false {product}
bool CrashOnOutOfMemoryError = false {product}
bool CreateMinidumpOnCrash = false {product}
bool CriticalJNINatives = true {product}
bool DTraceAllocProbes = false {product}
bool DTraceMethodProbes = false {product}
bool DTraceMonitorProbes = false {product}
bool Debugging = false {product}
uintx DefaultMaxRAMFraction = 4 {product}
intx DefaultThreadPriority = -1 {product}
intx DeferPollingPageLoopCount = -1 {product}
intx DeferThrSuspendLoopCount = 4000 {product}
bool DeoptimizeRandom = false {product}
bool DisableAttachMechanism = false {product}
bool DisableExplicitGC = false {product}
bool DisplayVMOutputToStderr = false {product}
bool DisplayVMOutputToStdout = false {product}
bool DoEscapeAnalysis = true {C2 product}
bool DontCompileHugeMethods = true {product}
bool DontYieldALot = false {pd product}
ccstr DumpLoadedClassList = {product}
bool DumpReplayDataOnError = true {product}
bool DumpSharedSpaces = false {product}
bool EagerXrunInit = false {product}
intx EliminateAllocationArraySizeLimit = 64 {C2 product}
bool EliminateAllocations = true {C2 product}
bool EliminateAutoBox = true {C2 product}
bool EliminateLocks = true {C2 product}
bool EliminateNestedLocks = true {C2 product}
intx EmitSync = 0 {product}
bool EnableContended = true {product}
bool EnableResourceManagementTLABCache = true {product}
bool EnableSharedLookupCache = true {product}
bool EnableTracing = false {product}
uintx ErgoHeapSizeLimit = 0 {product}
ccstr ErrorFile = {product}
ccstr ErrorReportServer = {product}
double EscapeAnalysisTimeout = 20.000000 {C2 product}
bool EstimateArgEscape = true {product}
bool ExitOnOutOfMemoryError = false {product}
bool ExplicitGCInvokesConcurrent = false {product}
bool ExplicitGCInvokesConcurrentAndUnloadsClasses = false {product}
bool ExtendedDTraceProbes = false {product}
ccstr ExtraSharedClassListFile = {product}
bool FLSAlwaysCoalesceLarge = false {product}
uintx FLSCoalescePolicy = 2 {product}
double FLSLargestBlockCoalesceProximity = 0.990000 {product}
bool FailOverToOldVerifier = true {product}
bool FastTLABRefill = true {product}
intx FenceInstruction = 0 {ARCH product}
intx FieldsAllocationStyle = 1 {product}
bool FilterSpuriousWakeups = true {product}
ccstr FlightRecorderOptions = {product}
bool ForceNUMA = false {product}
bool ForceTimeHighResolution = false {product}
intx FreqInlineSize = 325 {pd product}
double G1ConcMarkStepDurationMillis = 10.000000 {product}
uintx G1ConcRSHotCardLimit = 4 {product}
uintx G1ConcRSLogCacheSize = 10 {product}
intx G1ConcRefinementGreenZone = 0 {product}
intx G1ConcRefinementRedZone = 0 {product}
intx G1ConcRefinementServiceIntervalMillis = 300 {product}
uintx G1ConcRefinementThreads = 0 {product}
intx G1ConcRefinementThresholdStep = 0 {product}
intx G1ConcRefinementYellowZone = 0 {product}
uintx G1ConfidencePercent = 50 {product}
uintx G1HeapRegionSize = 0 {product}
uintx G1HeapWastePercent = 5 {product}
uintx G1MixedGCCountTarget = 8 {product}
intx G1RSetRegionEntries = 0 {product}
uintx G1RSetScanBlockSize = 64 {product}
intx G1RSetSparseRegionEntries = 0 {product}
intx G1RSetUpdatingPauseTimePercent = 10 {product}
intx G1RefProcDrainInterval = 10 {product}
uintx G1ReservePercent = 10 {product}
uintx G1SATBBufferEnqueueingThresholdPercent = 60 {product}
intx G1SATBBufferSize = 1024 {product}
intx G1UpdateBufferSize = 256 {product}
bool G1UseAdaptiveConcRefinement = true {product}
uintx GCDrainStackTargetSize = 64 {product}
uintx GCHeapFreeLimit = 2 {product}
uintx GCLockerEdenExpansionPercent = 5 {product}
bool GCLockerInvokesConcurrent = false {product}
uintx GCLogFileSize = 8192 {product}
uintx GCPauseIntervalMillis = 0 {product}
uintx GCTaskTimeStampEntries = 200 {product}
uintx GCTimeLimit = 98 {product}
uintx GCTimeRatio = 99 {product}
uintx HeapBaseMinAddress = 2147483648 {pd product}
bool HeapDumpAfterFullGC = false {manageable}
bool HeapDumpBeforeFullGC = false {manageable}
bool HeapDumpOnOutOfMemoryError = false {manageable}
ccstr HeapDumpPath = {manageable}
uintx HeapFirstMaximumCompactionCount = 3 {product}
uintx HeapMaximumCompactionInterval = 20 {product}
uintx HeapSizePerGCThread = 87241520 {product}
bool IgnoreEmptyClassPaths = false {product}
bool IgnoreUnrecognizedVMOptions = false {product}
uintx IncreaseFirstTierCompileThresholdAt = 50 {product}
bool IncrementalInline = true {C2 product}
uintx InitialBootClassLoaderMetaspaceSize = 4194304 {product}
uintx InitialCodeCacheSize = 2555904 {pd product}
uintx InitialHeapSize := 251658240 {product}
uintx InitialRAMFraction = 64 {product}
uintx InitialSurvivorRatio = 8 {product}
uintx InitialTenuringThreshold = 7 {product}
uintx InitiatingHeapOccupancyPercent = 45 {product}
bool Inline = true {product}
ccstr InlineDataFile = {product}
intx InlineSmallCode = 2000 {pd product}
bool InlineSynchronizedMethods = true {C1 product}
bool InsertMemBarAfterArraycopy = true {C2 product}
intx InteriorEntryAlignment = 16 {C2 pd product}
intx InterpreterProfilePercentage = 33 {product}
bool JNIDetachReleasesMonitors = true {product}
bool JavaMonitorsInStackTrace = true {product}
intx JavaPriority10_To_OSPriority = -1 {product}
intx JavaPriority1_To_OSPriority = -1 {product}
intx JavaPriority2_To_OSPriority = -1 {product}
intx JavaPriority3_To_OSPriority = -1 {product}
intx JavaPriority4_To_OSPriority = -1 {product}
intx JavaPriority5_To_OSPriority = -1 {product}
intx JavaPriority6_To_OSPriority = -1 {product}
intx JavaPriority7_To_OSPriority = -1 {product}
intx JavaPriority8_To_OSPriority = -1 {product}
intx JavaPriority9_To_OSPriority = -1 {product}
bool LIRFillDelaySlots = false {C1 pd product}
uintx LargePageHeapSizeThreshold = 134217728 {product}
uintx LargePageSizeInBytes = 0 {product}
bool LazyBootClassLoader = true {product}
intx LiveNodeCountInliningCutoff = 40000 {C2 product}
bool LogCommercialFeatures = false {product}
intx LoopMaxUnroll = 16 {C2 product}
intx LoopOptsCount = 43 {C2 product}
intx LoopUnrollLimit = 60 {C2 pd product}
intx LoopUnrollMin = 4 {C2 product}
bool LoopUnswitching = true {C2 product}
bool ManagementServer = false {product}
uintx MarkStackSize = 4194304 {product}
uintx MarkStackSizeMax = 536870912 {product}
uintx MarkSweepAlwaysCompactCount = 4 {product}
uintx MarkSweepDeadRatio = 1 {product}
intx MaxBCEAEstimateLevel = 5 {product}
intx MaxBCEAEstimateSize = 150 {product}
uintx MaxDirectMemorySize = 0 {product}
bool MaxFDLimit = true {product}
uintx MaxGCMinorPauseMillis = 4294967295 {product}
uintx MaxGCPauseMillis = 4294967295 {product}
uintx MaxHeapFreeRatio = 100 {manageable}
uintx MaxHeapSize := 4009754624 {product}
intx MaxInlineLevel = 9 {product}
intx MaxInlineSize = 35 {product}
intx MaxJNILocalCapacity = 65536 {product}
intx MaxJavaStackTraceDepth = 1024 {product}
intx MaxJumpTableSize = 65000 {C2 product}
intx MaxJumpTableSparseness = 5 {C2 product}
intx MaxLabelRootDepth = 1100 {C2 product}
intx MaxLoopPad = 15 {C2 product}
uintx MaxMetaspaceExpansion = 5451776 {product}
uintx MaxMetaspaceFreeRatio = 70 {product}
uintx MaxMetaspaceSize = 4294901760 {product}
uintx MaxNewSize := 1336410112 {product}
intx MaxNodeLimit = 75000 {C2 product}
uint64_t MaxRAM = 0 {pd product}
uintx MaxRAMFraction = 4 {product}
intx MaxRecursiveInlineLevel = 1 {product}
uintx MaxTenuringThreshold = 15 {product}
intx MaxTrivialSize = 6 {product}
intx MaxVectorSize = 16 {C2 product}
uintx MetaspaceSize = 21807104 {pd product}
bool MethodFlushing = true {product}
uintx MinHeapDeltaBytes := 524288 {product}
uintx MinHeapFreeRatio = 0 {manageable}
intx MinInliningThreshold = 250 {product}
intx MinJumpTableSize = 10 {C2 pd product}
uintx MinMetaspaceExpansion = 339968 {product}
uintx MinMetaspaceFreeRatio = 40 {product}
uintx MinRAMFraction = 2 {product}
uintx MinSurvivorRatio = 3 {product}
uintx MinTLABSize = 2048 {product}
intx MonitorBound = 0 {product}
bool MonitorInUseLists = false {product}
intx MultiArrayExpandLimit = 6 {C2 product}
bool MustCallLoadClassInternal = false {product}
uintx NUMAChunkResizeWeight = 20 {product}
uintx NUMAInterleaveGranularity = 2097152 {product}
uintx NUMAPageScanRate = 256 {product}
uintx NUMASpaceResizeRate = 1073741824 {product}
bool NUMAStats = false {product}
ccstr NativeMemoryTracking = off {product}
bool NeedsDeoptSuspend = false {pd product}
bool NeverActAsServerClassMachine = false {pd product}
bool NeverTenure = false {product}
uintx NewRatio = 2 {product}
uintx NewSize := 83886080 {product}
uintx NewSizeThreadIncrease = 5320 {pd product}
intx NmethodSweepActivity = 10 {product}
intx NmethodSweepCheckInterval = 5 {product}
intx NmethodSweepFraction = 16 {product}
intx NodeLimitFudgeFactor = 2000 {C2 product}
uintx NumberOfGCLogFiles = 0 {product}
intx NumberOfLoopInstrToAlign = 4 {C2 product}
intx ObjectAlignmentInBytes = 8 {lp64_product}
uintx OldPLABSize = 1024 {product}
uintx OldPLABWeight = 50 {product}
uintx OldSize := 167772160 {product}
bool OmitStackTraceInFastThrow = true {product}
ccstrlist OnError = {product}
ccstrlist OnOutOfMemoryError = {product}
intx OnStackReplacePercentage = 140 {pd product}
bool OptimizeFill = true {C2 product}
bool OptimizePtrCompare = true {C2 product}
bool OptimizeStringConcat = true {C2 product}
bool OptoBundling = false {C2 pd product}
intx OptoLoopAlignment = 16 {pd product}
bool OptoScheduling = false {C2 pd product}
uintx PLABWeight = 75 {product}
bool PSChunkLargeArrays = true {product}
intx ParGCArrayScanChunk = 50 {product}
uintx ParGCDesiredObjsFromOverflowList = 20 {product}
bool ParGCTrimOverflow = true {product}
bool ParGCUseLocalOverflow = false {product}
uintx ParallelGCBufferWastePct = 10 {product}
uintx ParallelGCThreads = 8 {product}
bool ParallelGCVerbose = false {product}
uintx ParallelOldDeadWoodLimiterMean = 50 {product}
uintx ParallelOldDeadWoodLimiterStdDev = 80 {product}
bool ParallelRefProcBalancingEnabled = true {product}
bool ParallelRefProcEnabled = false {product}
bool PartialPeelAtUnsignedTests = true {C2 product}
bool PartialPeelLoop = true {C2 product}
intx PartialPeelNewPhiDelta = 0 {C2 product}
uintx PausePadding = 1 {product}
intx PerBytecodeRecompilationCutoff = 200 {product}
intx PerBytecodeTrapLimit = 4 {product}
intx PerMethodRecompilationCutoff = 400 {product}
intx PerMethodTrapLimit = 100 {product}
bool PerfAllowAtExitRegistration = false {product}
bool PerfBypassFileSystemCheck = false {product}
intx PerfDataMemorySize = 32768 {product}
intx PerfDataSamplingInterval = 50 {product}
ccstr PerfDataSaveFile = {product}
bool PerfDataSaveToFile = false {product}
bool PerfDisableSharedMem = false {product}
intx PerfMaxStringConstLength = 1024 {product}
intx PreInflateSpin = 10 {pd product}
bool PreferInterpreterNativeStubs = false {pd product}
intx PrefetchCopyIntervalInBytes = 576 {product}
intx PrefetchFieldsAhead = 1 {product}
intx PrefetchScanIntervalInBytes = 576 {product}
bool PreserveAllAnnotations = false {product}
bool PreserveFramePointer = false {pd product}
uintx PretenureSizeThreshold = 0 {product}
bool PrintAdaptiveSizePolicy = false {product}
bool PrintCMSInitiationStatistics = false {product}
intx PrintCMSStatistics = 0 {product}
bool PrintClassHistogram = false {manageable}
bool PrintClassHistogramAfterFullGC = false {manageable}
bool PrintClassHistogramBeforeFullGC = false {manageable}
bool PrintCodeCache = false {product}
bool PrintCodeCacheOnCompilation = false {product}
bool PrintCommandLineFlags = false {product}
bool PrintCompilation = false {product}
bool PrintConcurrentLocks = false {manageable}
intx PrintFLSCensus = 0 {product}
intx PrintFLSStatistics = 0 {product}
bool PrintFlagsFinal := true {product}
bool PrintFlagsInitial = false {product}
bool PrintGC = false {manageable}
bool PrintGCApplicationConcurrentTime = false {product}
bool PrintGCApplicationStoppedTime = false {product}
bool PrintGCCause = true {product}
bool PrintGCDateStamps = false {manageable}
bool PrintGCDetails = false {manageable}
bool PrintGCID = false {manageable}
bool PrintGCTaskTimeStamps = false {product}
bool PrintGCTimeStamps = false {manageable}
bool PrintHeapAtGC = false {product rw}
bool PrintHeapAtGCExtended = false {product rw}
bool PrintHeapAtSIGBREAK = true {product}
bool PrintJNIGCStalls = false {product}
bool PrintJNIResolving = false {product}
bool PrintOldPLAB = false {product}
bool PrintOopAddress = false {product}
bool PrintPLAB = false {product}
bool PrintParallelOldGCPhaseTimes = false {product}
bool PrintPromotionFailure = false {product}
bool PrintReferenceGC = false {product}
bool PrintSafepointStatistics = false {product}
intx PrintSafepointStatisticsCount = 300 {product}
intx PrintSafepointStatisticsTimeout = -1 {product}
bool PrintSharedArchiveAndExit = false {product}
bool PrintSharedDictionary = false {product}
bool PrintSharedSpaces = false {product}
bool PrintStringDeduplicationStatistics = false {product}
bool PrintStringTableStatistics = false {product}
bool PrintTLAB = false {product}
bool PrintTenuringDistribution = false {product}
bool PrintTieredEvents = false {product}
bool PrintVMOptions = false {product}
bool PrintVMQWaitTime = false {product}
bool PrintWarnings = true {product}
uintx ProcessDistributionStride = 4 {product}
bool ProfileInterpreter = true {pd product}
bool ProfileIntervals = false {product}
intx ProfileIntervalsTicks = 100 {product}
intx ProfileMaturityPercentage = 20 {product}
bool ProfileVM = false {product}
bool ProfilerPrintByteCodeStatistics = false {product}
bool ProfilerRecordPC = false {product}
uintx PromotedPadding = 3 {product}
uintx QueuedAllocationWarningCount = 0 {product}
uintx RTMRetryCount = 5 {ARCH product}
bool RangeCheckElimination = true {product}
intx ReadPrefetchInstr = 0 {ARCH product}
bool ReassociateInvariants = true {C2 product}
bool ReduceBulkZeroing = true {C2 product}
bool ReduceFieldZeroing = true {C2 product}
bool ReduceInitialCardMarks = true {C2 product}
bool ReduceSignalUsage = false {product}
intx RefDiscoveryPolicy = 0 {product}
bool ReflectionWrapResolutionErrors = true {product}
bool RegisterFinalizersAtInit = true {product}
bool RelaxAccessControlCheck = false {product}
ccstr ReplayDataFile = {product}
bool RequireSharedSpaces = false {product}
uintx ReservedCodeCacheSize = 251658240 {pd product}
bool ResizeOldPLAB = true {product}
bool ResizePLAB = true {product}
bool ResizeTLAB = true {pd product}
bool RestoreMXCSROnJNICalls = false {product}
bool RestrictContended = true {product}
bool RewriteBytecodes = true {pd product}
bool RewriteFrequentPairs = true {pd product}
intx SafepointPollOffset = 256 {C1 pd product}
intx SafepointSpinBeforeYield = 2000 {product}
bool SafepointTimeout = false {product}
intx SafepointTimeoutDelay = 10000 {product}
bool ScavengeBeforeFullGC = true {product}
intx SelfDestructTimer = 0 {product}
uintx SharedBaseAddress = 0 {product}
ccstr SharedClassListFile = {product}
uintx SharedMiscCodeSize = 122880 {product}
uintx SharedMiscDataSize = 4194304 {product}
uintx SharedReadOnlySize = 16777216 {product}
uintx SharedReadWriteSize = 16777216 {product}
bool ShowMessageBoxOnError = false {product}
intx SoftRefLRUPolicyMSPerMB = 1000 {product}
bool SpecialEncodeISOArray = true {C2 product}
bool SplitIfBlocks = true {C2 product}
intx StackRedPages = 1 {pd product}
intx StackShadowPages = 6 {pd product}
bool StackTraceInThrowable = true {product}
intx StackYellowPages = 3 {pd product}
bool StartAttachListener = false {product}
intx StarvationMonitorInterval = 200 {product}
bool StressLdcRewrite = false {product}
uintx StringDeduplicationAgeThreshold = 3 {product}
uintx StringTableSize = 60013 {product}
bool SuppressFatalErrorMessage = false {product}
uintx SurvivorPadding = 3 {product}
uintx SurvivorRatio = 8 {product}
intx SuspendRetryCount = 50 {product}
intx SuspendRetryDelay = 5 {product}
intx SyncFlags = 0 {product}
ccstr SyncKnobs = {product}
intx SyncVerbose = 0 {product}
uintx TLABAllocationWeight = 35 {product}
uintx TLABRefillWasteFraction = 64 {product}
uintx TLABSize = 0 {product}
bool TLABStats = true {product}
uintx TLABWasteIncrement = 4 {product}
uintx TLABWasteTargetPercent = 1 {product}
uintx TargetPLABWastePct = 10 {product}
uintx TargetSurvivorRatio = 50 {product}
uintx TenuredGenerationSizeIncrement = 20 {product}
uintx TenuredGenerationSizeSupplement = 80 {product}
uintx TenuredGenerationSizeSupplementDecay = 2 {product}
intx ThreadPriorityPolicy = 0 {product}
bool ThreadPriorityVerbose = false {product}
uintx ThreadSafetyMargin = 52428800 {product}
intx ThreadStackSize = 0 {pd product}
uintx ThresholdTolerance = 10 {product}
intx Tier0BackedgeNotifyFreqLog = 10 {product}
intx Tier0InvokeNotifyFreqLog = 7 {product}
intx Tier0ProfilingStartPercentage = 200 {product}
intx Tier23InlineeNotifyFreqLog = 20 {product}
intx Tier2BackEdgeThreshold = 0 {product}
intx Tier2BackedgeNotifyFreqLog = 14 {product}
intx Tier2CompileThreshold = 0 {product}
intx Tier2InvokeNotifyFreqLog = 11 {product}
intx Tier3BackEdgeThreshold = 60000 {product}
intx Tier3BackedgeNotifyFreqLog = 13 {product}
intx Tier3CompileThreshold = 2000 {product}
intx Tier3DelayOff = 2 {product}
intx Tier3DelayOn = 5 {product}
intx Tier3InvocationThreshold = 200 {product}
intx Tier3InvokeNotifyFreqLog = 10 {product}
intx Tier3LoadFeedback = 5 {product}
intx Tier3MinInvocationThreshold = 100 {product}
intx Tier4BackEdgeThreshold = 40000 {product}
intx Tier4CompileThreshold = 15000 {product}
intx Tier4InvocationThreshold = 5000 {product}
intx Tier4LoadFeedback = 3 {product}
intx Tier4MinInvocationThreshold = 600 {product}
bool TieredCompilation = true {pd product}
intx TieredCompileTaskTimeout = 50 {product}
intx TieredRateUpdateMaxTime = 25 {product}
intx TieredRateUpdateMinTime = 1 {product}
intx TieredStopAtLevel = 4 {product}
bool TimeLinearScan = false {C1 product}
bool TraceBiasedLocking = false {product}
bool TraceClassLoading = false {product rw}
bool TraceClassLoadingPreorder = false {product}
bool TraceClassPaths = false {product}
bool TraceClassResolution = false {product}
bool TraceClassUnloading = false {product rw}
bool TraceDynamicGCThreads = false {product}
bool TraceGen0Time = false {product}
bool TraceGen1Time = false {product}
ccstr TraceJVMTI = {product}
bool TraceLoaderConstraints = false {product rw}
bool TraceMetadataHumongousAllocation = false {product}
bool TraceMonitorInflation = false {product}
bool TraceParallelOldGCTasks = false {product}
intx TraceRedefineClasses = 0 {product}
bool TraceSafepointCleanupTime = false {product}
bool TraceSharedLookupCache = false {product}
bool TraceSuspendWaitFailures = false {product}
intx TrackedInitializationLimit = 50 {C2 product}
bool TransmitErrorReport = false {product}
bool TrapBasedNullChecks = false {pd product}
bool TrapBasedRangeChecks = false {C2 pd product}
intx TypeProfileArgsLimit = 2 {product}
uintx TypeProfileLevel = 111 {pd product}
intx TypeProfileMajorReceiverPercent = 90 {C2 product}
intx TypeProfileParmsLimit = 2 {product}
intx TypeProfileWidth = 2 {product}
intx UnguardOnExecutionViolation = 0 {product}
bool UnlinkSymbolsALot = false {product}
bool Use486InstrsOnly = false {ARCH product}
bool UseAES = true {product}
bool UseAESIntrinsics = true {product}
intx UseAVX = 2 {ARCH product}
bool UseAdaptiveGCBoundary = false {product}
bool UseAdaptiveGenerationSizePolicyAtMajorCollection = true {product}
bool UseAdaptiveGenerationSizePolicyAtMinorCollection = true {product}
bool UseAdaptiveNUMAChunkSizing = true {product}
bool UseAdaptiveSizeDecayMajorGCCost = true {product}
bool UseAdaptiveSizePolicy = true {product}
bool UseAdaptiveSizePolicyFootprintGoal = true {product}
bool UseAdaptiveSizePolicyWithSystemGC = false {product}
bool UseAddressNop = true {ARCH product}
bool UseAltSigs = false {product}
bool UseAutoGCSelectPolicy = false {product}
bool UseBMI1Instructions = true {ARCH product}
bool UseBMI2Instructions = false {ARCH product}
bool UseBiasedLocking = true {product}
bool UseBimorphicInlining = true {C2 product}
bool UseBoundThreads = true {product}
bool UseCLMUL = true {ARCH product}
bool UseCMSBestFit = true {product}
bool UseCMSCollectionPassing = true {product}
bool UseCMSCompactAtFullCollection = true {product}
bool UseCMSInitiatingOccupancyOnly = false {product}
bool UseCRC32Intrinsics = true {product}
bool UseCodeCacheFlushing = true {product}
bool UseCompiler = true {product}
bool UseCompilerSafepoints = true {product}
bool UseCompressedClassPointers := true {lp64_product}
bool UseCompressedOops := true {lp64_product}
bool UseConcMarkSweepGC = false {product}
bool UseCondCardMark = false {C2 product}
bool UseCountLeadingZerosInstruction = true {ARCH product}
bool UseCountTrailingZerosInstruction = true {ARCH product}
bool UseCountedLoopSafepoints = false {C2 product}
bool UseCounterDecay = true {product}
bool UseDivMod = true {C2 product}
bool UseDynamicNumberOfGCThreads = false {product}
bool UseFPUForSpilling = false {C2 product}
bool UseFastAccessorMethods = false {product}
bool UseFastEmptyMethods = false {product}
bool UseFastJNIAccessors = true {product}
bool UseFastStosb = false {ARCH product}
bool UseG1GC = false {product}
bool UseGCLogFileRotation = false {product}
bool UseGCOverheadLimit = true {product}
bool UseGCTaskAffinity = false {product}
bool UseHeavyMonitors = false {product}
bool UseInlineCaches = true {product}
bool UseInterpreter = true {product}
bool UseJumpTables = true {C2 product}
bool UseLWPSynchronization = true {product}
bool UseLargePages = false {pd product}
bool UseLargePagesInMetaspace = false {product}
bool UseLargePagesIndividualAllocation := false {pd product}
bool UseLockedTracing = false {product}
bool UseLoopCounter = true {product}
bool UseLoopInvariantCodeMotion = true {C1 product}
bool UseLoopPredicate = true {C2 product}
bool UseMathExactIntrinsics = true {C2 product}
bool UseMaximumCompactionOnSystemGC = true {product}
bool UseMembar = false {pd product}
bool UseMontgomeryMultiplyIntrinsic = false {C2 product}
bool UseMontgomerySquareIntrinsic = false {C2 product}
bool UseMulAddIntrinsic = false {C2 product}
bool UseMultiplyToLenIntrinsic = true {C2 product}
bool UseNUMA = false {product}
bool UseNUMAInterleaving = false {product}
bool UseNewLongLShift = true {ARCH product}
bool UseOSErrorReporting = false {pd product}
bool UseOldInlining = true {C2 product}
bool UseOnStackReplacement = true {pd product}
bool UseOnlyInlinedBimorphic = true {C2 product}
bool UseOptoBiasInlining = true {C2 product}
bool UsePSAdaptiveSurvivorSizePolicy = true {product}
bool UseParNewGC = false {product}
bool UseParallelGC := true {product}
bool UseParallelOldGC = true {product}
bool UsePerfData = true {product}
bool UsePopCountInstruction = true {product}
bool UseRDPCForConstantTableBase = false {C2 product}
bool UseRTMDeopt = false {ARCH product}
bool UseRTMLocking = false {ARCH product}
bool UseSHA = false {product}
bool UseSHA1Intrinsics = false {product}
bool UseSHA256Intrinsics = false {product}
bool UseSHA512Intrinsics = false {product}
intx UseSSE = 4 {product}
bool UseSSE42Intrinsics = true {product}
bool UseSerialGC = false {product}
bool UseSharedSpaces = false {product}
bool UseSignalChaining = true {product}
bool UseSquareToLenIntrinsic = false {C2 product}
bool UseStoreImmI16 = true {ARCH product}
bool UseStringDeduplication = false {product}
bool UseSuperWord = true {C2 product}
bool UseTLAB = true {pd product}
bool UseThreadPriorities = true {pd product}
bool UseTypeProfile = true {product}
bool UseTypeSpeculation = true {C2 product}
bool UseUTCFileTimestamp = true {product}
bool UseUnalignedLoadStores = false {ARCH product}
bool UseVMInterruptibleIO = false {product}
bool UseXMMForArrayCopy = false {product}
bool UseXmmI2D = true {ARCH product}
bool UseXmmI2F = true {ARCH product}
bool UseXmmLoadAndClearUpper = true {ARCH product}
bool UseXmmRegToRegMoveAll = true {ARCH product}
bool VMThreadHintNoPreempt = false {product}
intx VMThreadPriority = -1 {product}
intx VMThreadStackSize = 0 {pd product}
intx ValueMapInitialSize = 11 {C1 product}
intx ValueMapMaxLoopSize = 8 {C1 product}
intx ValueSearchLimit = 1000 {C2 product}
bool VerifyMergedCPBytecodes = true {product}
bool VerifySharedSpaces = false {product}
intx WorkAroundNPTLTimedWaitHang = 1 {product}
uintx YoungGenerationSizeIncrement = 20 {product}
uintx YoungGenerationSizeSupplement = 80 {product}
uintx YoungGenerationSizeSupplementDecay = 8 {product}
uintx YoungPLABSize = 4096 {product}
bool ZeroTLAB = false {product}
intx hashCode = 5 {product}
================================================
FILE: mvnw
================================================
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Maven2 Start Up Batch script
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# M2_HOME - location of maven2's installed home dir
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
if [ -z "$MAVEN_SKIP_RC" ] ; then
if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi
if [ -f "$HOME/.mavenrc" ] ; then
. "$HOME/.mavenrc"
fi
fi
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
mingw=false
case "`uname`" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true;;
Darwin*) darwin=true
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
if [ -z "$JAVA_HOME" ]; then
if [ -x "/usr/libexec/java_home" ]; then
export JAVA_HOME="`/usr/libexec/java_home`"
else
export JAVA_HOME="/Library/Java/Home"
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=`java-config --jre-home`
fi
fi
if [ -z "$M2_HOME" ] ; then
## resolve links - $0 may be a link to maven's home
PRG="$0"
# need this for relative symlinks
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done
saveddir=`pwd`
M2_HOME=`dirname "$PRG"`/..
# make it fully qualified
M2_HOME=`cd "$M2_HOME" && pwd`
cd "$saveddir"
# echo Using m2 at $M2_HOME
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --unix "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
# For Mingw, ensure paths are in UNIX format before anything is touched
if $mingw ; then
[ -n "$M2_HOME" ] &&
M2_HOME="`(cd "$M2_HOME"; pwd)`"
[ -n "$JAVA_HOME" ] &&
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
fi
if [ -z "$JAVA_HOME" ]; then
javaExecutable="`which javac`"
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
# readlink(1) is not available as standard on Solaris 10.
readLink=`which readlink`
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
if $darwin ; then
javaHome="`dirname \"$javaExecutable\"`"
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
else
javaExecutable="`readlink -f \"$javaExecutable\"`"
fi
javaHome="`dirname \"$javaExecutable\"`"
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
JAVA_HOME="$javaHome"
export JAVA_HOME
fi
fi
fi
if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD="`which java`"
fi
fi
if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly." >&2
echo " We cannot execute $JAVACMD" >&2
exit 1
fi
if [ -z "$JAVA_HOME" ] ; then
echo "Warning: JAVA_HOME environment variable is not set."
fi
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {
if [ -z "$1" ]
then
echo "Path not specified to find_maven_basedir"
return 1
fi
basedir="$1"
wdir="$1"
while [ "$wdir" != '/' ] ; do
if [ -d "$wdir"/.mvn ] ; then
basedir=$wdir
break
fi
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
if [ -d "${wdir}" ]; then
wdir=`cd "$wdir/.."; pwd`
fi
# end of workaround
done
echo "${basedir}"
}
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' < "$1")"
fi
}
BASE_DIR=`find_maven_basedir "$(pwd)"`
if [ -z "$BASE_DIR" ]; then
exit 1;
fi
##########################################################################################
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
# This allows using the maven wrapper in projects that prohibit checking in binary data.
##########################################################################################
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found .mvn/wrapper/maven-wrapper.jar"
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
fi
if [ -n "$MVNW_REPOURL" ]; then
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.3/maven-wrapper-0.5.3.jar"
else
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.3/maven-wrapper-0.5.3.jar"
fi
while IFS="=" read key value; do
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
esac
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
if [ "$MVNW_VERBOSE" = true ]; then
echo "Downloading from: $jarUrl"
fi
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
if $cygwin; then
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
fi
if command -v wget > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found wget ... using wget"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
wget "$jarUrl" -O "$wrapperJarPath"
else
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
fi
elif command -v curl > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found curl ... using curl"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
curl -o "$wrapperJarPath" "$jarUrl" -f
else
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Falling back to using Java to download"
fi
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
# For Cygwin, switch paths to Windows format before running javac
if $cygwin; then
javaClass=`cygpath --path --windows "$javaClass"`
fi
if [ -e "$javaClass" ]; then
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Compiling MavenWrapperDownloader.java ..."
fi
# Compiling the Java class
("$JAVA_HOME/bin/javac" "$javaClass")
fi
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
# Running the downloader
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Running MavenWrapperDownloader.java ..."
fi
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
fi
fi
fi
fi
##########################################################################################
# End of extension
##########################################################################################
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
if [ "$MVNW_VERBOSE" = true ]; then
echo $MAVEN_PROJECTBASEDIR
fi
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --path --windows "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
fi
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
exec "$JAVACMD" \
$MAVEN_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
================================================
FILE: mvnw.cmd
================================================
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM https://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Maven2 Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
:skipRcPre
@setlocal
set ERROR_CODE=0
@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal
@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome
echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init
echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
@REM ==== END VALIDATION ====
:init
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir
:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir
:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"
:endDetectBaseDir
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
:endReadAdditionalConfig
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.3/maven-wrapper-0.5.3.jar"
FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
)
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
if exist %WRAPPER_JAR% (
echo Found %WRAPPER_JAR%
) else (
if not "%MVNW_REPOURL%" == "" (
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.3/maven-wrapper-0.5.3.jar"
)
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %DOWNLOAD_URL%
powershell -Command "&{"^
"$webclient = new-object System.Net.WebClient;"^
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
"}"^
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
"}"
echo Finished downloading %WRAPPER_JAR%
)
@REM End of extension
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
:skipRcPost
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
exit /B %ERROR_CODE%
================================================
FILE: pom.xml
================================================
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mark</groupId>
<artifactId>JavaBasic</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>JavaBasic</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.7</version>
</dependency>
<!-- MaxMind -->
<dependency>
<groupId>com.maxmind.geoip2</groupId>
<artifactId>geoip2</artifactId>
<version>2.12.0</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.83</version>
</dependency>
<dependency>
<groupId>io.azam.ulidj</groupId>
<artifactId>ulidj</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
================================================
FILE: src/main/java/com/annotation/README.md
================================================
# 按运行机制分类
- 源码注解:注解只在源码中存在,编译成.class文件就不存在了
- 编译时注解:在源码和.class文件中都会存在注解
- 运行时注解:在运行阶段还起作用,甚至韵影像运行逻辑的注解
# 按来源分类
- JDK 中自带的注解
- 第三方的注解
- 我们自定义注解
# 自定义注解
- 自定义注解语法要求
- 注解的注解(元注解)
- 使用自定义注解
- 解析注解
```
package com.sun.org.glassfish.gmbal;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Documented
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface Description { //使用 @interface 来定义注解
String value(); // 成员以无参无异常方式声明
String key() default ""; 可以使用 default 为成员指定一个默认值
}
```
> 成员的类型是受限制的,合法的类型包括Java基本类型及 String, Class, Annotation, Enumeration
>
> 如果注解只有一个成员,则成员名必须取名为value(), 在使用时可以忽略成员名和赋值号(=)
>
> 注解类可以没有成员,没有成员的注解可以被称为标识注解
## 元注解
```
// 作用范围
public enum ElementType {
/** Class, interface (including annotation type), or enum declaration */
TYPE,
/** Field declaration (includes enum constants) */
FIELD,
/** Method declaration */
METHOD,
/** Formal parameter declaration */
PARAMETER,
/** Constructor declaration */
CONSTRUCTOR,
/** Local variable declaration */
LOCAL_VARIABLE,
/** Annotation type declaration */
ANNOTATION_TYPE,
/** Package declaration */
PACKAGE,
/**
* Type parameter declaration
*
* @since 1.8
*/
TYPE_PARAMETER,
/**
* Use of a type
*
* @since 1.8
*/
TYPE_USE
}
```
```
// Retention n. 保留;保持;维持;记忆力
// 生命周期
public enum RetentionPolicy {
/**
* Annotations are to be discarded by the compiler.
*/
SOURCE,
/**
* Annotations are to be recorded in the class file by the compiler
* but need not be retained by the VM at run time. This is the default
* behavior.
*/
CLASS,
/**
* Annotations are to be recorded in the class file by the compiler and
* retained by the VM at run time, so they may be read reflectively.
*
* @see java.lang.reflect.AnnotatedElement
*/
RUNTIME
}
```
```
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.ANNOTATION_TYPE)
public @interface Inherited {
}
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.ANNOTATION_TYPE)
public @interface Documented {
}
```
## 自定义注解使用
```
package com.annotation.own;
import java.lang.annotation.*;
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Inherited // 类之间继承上,接口实现不算
@Documented
public @interface Description {
String value();
String desc();
String author();
int age() default 18;
}
```
# 解析注解
- 通过**反射**获取类,函数或成员上的运行时注解信息,从而实现动态控制程序运行逻辑
# 项目实战 见 project 包中
- 项目取自一个公司的持久层框架,用来代替Hibernete的解决方案,核心代码通过注解来实现
- 需求
- 有一张用户表,字段用户id, 用户名, 昵称, 年龄, 性别, 所在城市, 邮箱, 手机号
- 方便对每个字段或字段组合条件进行检索,并打印出SQL
- 使用方式足够简单,见代码实例
- 可以看看 mybatis-plus 的源代码
================================================
FILE: src/main/java/com/annotation/jdk/Child.java
================================================
package com.annotation.jdk;
import com.annotation.own.Description;
/**
* @Override 这个注解 告诉编译器 / 程序员,方法覆盖接口中方法
* Indicates that a method declaration is intended to override a method declaration in a supertype.
* If a method is annotated with this annotation type compilers are required to generate an error
* message unless at least one of the following conditions hold:
*
* The method does override or implement a method declared in a supertype.
* The method has a signature that is override-equivalent to that of any public method declared in Object.
*/
@Description("I am a class annotation.")
public class Child implements Person {
@Override
@Description("I am a method annotation.")
public String name() {
return null;
}
@Override
public int age() {
return 0;
}
@Override
public void sing() {
}
}
================================================
FILE: src/main/java/com/annotation/jdk/ParseAnnotation.java
================================================
package com.annotation.jdk;
import com.annotation.own.Description;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
public class ParseAnnotation {
public static void main(String[] args) {
// 1. 使用类加载器加载类
try {
Class c = Class.forName("com.annotation.jdk.Child");
// 2. 找到类上的注解
boolean flag = c.isAnnotationPresent(Description.class);
if (flag) {
// 3. 拿到注解实例
Description description = (Description) c.getAnnotation(Description.class);
System.out.println(description.value());
}
// 4. 找到方法上的注解
Method[] ms = c.getMethods();
for (Method m : ms) {
boolean annotationPresent = m.isAnnotationPresent(Description.class);
if (annotationPresent) {
Description description = m.getAnnotation(Description.class);
System.out.println(description.value());
}
}
// 5. 另一种解析方法
for (Method m : ms) {
Annotation[] as = m.getAnnotations();
for (Annotation a : as) {
if (a instanceof Description) {
Description description = (Description) a;
System.out.println(description.value());
}
}
}
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
}
================================================
FILE: src/main/java/com/annotation/jdk/Person.java
================================================
package com.annotation.jdk;
/**
* Java 注解从 Java 5开始
* @Deprecated 已过时;被废弃
* A program element annotated @Deprecated is one that programmers are discouraged from using,
* typically because it is dangerous, or because a better alternative exists. Compilers warn
* when a deprecated program element is used or overridden in non-deprecated code.
*/
public interface Person {
public String name();
public int age();
@Deprecated
public void sing();
}
================================================
FILE: src/main/java/com/annotation/jdk/Test.java
================================================
package com.annotation.jdk;
/**
* @SuppressWarnings suppress v. 抑制,压制,阻止
* Indicates that the named compiler warnings should be suppressed in the annotated element
* (and in all program elements contained in the annotated element). Note that the set of warnings
* suppressed in a given element is a superset of the warnings suppressed in all containing elements.
* For example, if you annotate a class to suppress one warning and annotate a method to suppress another,
* both warnings will be suppressed in the method.
*
* As a matter of style, programmers should always use this annotation on the most deeply nested element
* where it is effective. If you want to suppress a warning in a particular method, you should annotate
* that method rather than its class.
*/
public class Test {
@SuppressWarnings("deprecation")
public void sing(String[] args) {
Person p = new Child();
p.sing();
}
}
================================================
FILE: src/main/java/com/annotation/own/Description.java
================================================
package com.annotation.own;
import java.lang.annotation.*;
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
public @interface Description {
String value() default "";
}
================================================
FILE: src/main/java/com/annotation/project/Column.java
================================================
package com.annotation.project;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Column {
String value();
}
================================================
FILE: src/main/java/com/annotation/project/Department.java
================================================
package com.annotation.project;
@Table("t_department")
public class Department {
@Column("id")
private int id;
@Column("name")
private String name;
@Column("leader")
private String leader;
@Column("amount")
private int amount;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getLeader() {
return leader;
}
public void setLeader(String leader) {
this.leader = leader;
}
public int getAmount() {
return amount;
}
public void setAmout(int amount) {
this.amount = amount;
}
}
================================================
FILE: src/main/java/com/annotation/project/Table.java
================================================
package com.annotation.project;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface Table {
String value();
}
================================================
FILE: src/main/java/com/annotation/project/Test.java
================================================
package com.annotation.project;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
public class Test {
public static void main(String[] args) {
User u1 = new User();
u1.setId(10); // 查询 id 为10的用户
User u2 = new User();
u2.setUserName("lucy"); // 模糊查询用户名为 lucy 的用户
User u3 = new User();
u2.setEmail("mark@gmail.com,puma@163.com"); // 查询任意一个邮箱
String sql1 = query(u1);
String sql2 = query(u2);
String sql3 = query(u3);
System.out.println(sql1);
System.out.println(sql2);
System.out.println(sql3);
Department d = new Department();
d.setId(10);
d.setLeader("张三丰");
System.out.println(query(d));
}
private static String query(Object u) {
StringBuilder sb = new StringBuilder();
// 1. 获取 class
Class c = u.getClass();
// 2. 获取 table 名字
boolean exist = c.isAnnotationPresent(Table.class);
if (!exist) {
return null;
}
Table table = (Table) c.getAnnotation(Table.class);
String tableName = table.value();
sb.append("SELECT * FROM ").append(tableName).append(" WHERE 1=1");
// 遍历所有的字段
Field[] declaredFields = c.getDeclaredFields();
for (Field f : declaredFields) {
// 处理字段对应的 SQL
// 拿到字段的名字
boolean annotationPresent = f.isAnnotationPresent(Column.class);
if (!annotationPresent) {
continue;
}
Column column = f.getAnnotation(Column.class);
String columnName = column.value();
// 拿到字段的值
String fieldName = f.getName();
String method = "get" + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1);
Object fieldValue = null;
try {
Method invokeMethod = c.getMethod(method);
fieldValue = invokeMethod.invoke(u);
} catch (Exception e) {
e.printStackTrace();
}
// 拼装 SQL
if (fieldValue == null || (fieldValue instanceof Integer && (int) fieldValue == 0)) {
continue;
}
sb.append(" AND ").append(fieldName);
if (fieldValue instanceof String) {
if (((String) fieldValue).contains(",")) {
String[] strings = ((String) fieldValue).split(",");
sb.append(" IN (");
// int count = 0; // counter
// for (String s : strings) {
// ++ count;
// sb.append("'").append(s).append("'");
// if (count == strings.length) {
// sb.append(")");
// } else {
// sb.append(",");
// }
// }
for (String s : strings) {
sb.append("'").append(s).append("'").append(",");
}
sb.deleteCharAt(sb.length() - 1);
sb.append(")");
} else {
sb.append("=").append("'").append(fieldValue).append("'");
}
} else if (fieldValue instanceof Integer) {
sb.append("=").append(fieldValue);
}
}
return sb.toString();
}
}
================================================
FILE: src/main/java/com/annotation/project/User.java
================================================
package com.annotation.project;
@Table("t_user")
public class User {
@Column("id")
private int id;
@Column("user_name")
private String userName;
@Column("nick_name")
private String nickName;
@Column("age")
private int age;
@Column("city")
private String city;
@Column("email")
private String email;
@Column("mobile")
private String mobile;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
}
================================================
FILE: src/main/java/com/art/concurrency/ch01/ConcurrencyTest.java
================================================
package com.art.concurrency.ch01;
/**
* 1. 循环次数
* 2. 串并行程序实行时间
* 3. Lmbench3 http://www.bitmover.com/lmbench/ 上下文切换的时长
* 4. vmstat 上下文切换的次数
* 5. 如何减少上下文切换
* 无锁并发编程, CAS算法, 使用最少线程, 使用协程
* 无锁并发编程:不同线程处理不同段的数据
*/
public class ConcurrencyTest {
private static final long count = 100001;
public static void main(String[] args) throws InterruptedException {
concurrency();
serial();
}
private static void serial() {
long start = System.currentTimeMillis();
int a = 0;
for (long i = 0; i < count; i++) {
a += 5;
}
int b = 0;
for (long i = 0; i < count; i++) {
b--;
}
long time = System.currentTimeMillis() - start;
System.out.println("serial: " + time);
}
private static void concurrency() throws InterruptedException {
long start = System.currentTimeMillis();
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
int a = 0;
for (long i = 0; i < count; i++) {
a += 5;
}
}
});
thread.start();
int b = 0;
for (long i = 0; i < count; i++) {
b--;
}
long time = System.currentTimeMillis() - start;
thread.join();
System.out.println("concurrency: " + time);
}
}
================================================
FILE: src/main/java/com/art/concurrency/ch01/DeadLockDemo.java
================================================
package com.art.concurrency.ch01;
public class DeadLockDemo {
private static String A = "A";
private static String B = "B";
public static void main(String[] args) {
new DeadLockDemo().deadLock();
}
private void deadLock() {
Thread t1 = new Thread(new Runnable() {
@Override
public void run() {
synchronized (A) {
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
}
synchronized (B) {
System.out.println("1");
}
}
}
});
Thread t2 = new Thread(new Runnable() {
@Override
public void run() {
synchronized (B) {
try {
Thread.sleep(9000);
} catch (InterruptedException e) {
e.printStackTrace();
}
synchronized (A) {
System.out.println("2");
}
}
}
});
t1.start();
t2.start();
}
}
================================================
FILE: src/main/java/com/art/concurrency/ch04/Daemon.java
================================================
package com.art.concurrency.ch04;
import com.art.concurrency.utils.SleepUtils;
public class Daemon {
public static void main(String[] args) {
Thread thread = new Thread(new DaemonRunner(), "DaemonRunner");
thread.setDaemon(Boolean.TRUE);
thread.start();
}
static class DaemonRunner implements Runnable {
@Override
public void run() {
SleepUtils.second(10);
}
}
}
================================================
FILE: src/main/java/com/art/concurrency/ch04/Deprecated.java
================================================
package com.art.concurrency.ch04;
import com.art.concurrency.utils.SleepUtils;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.concurrent.TimeUnit;
public class Deprecated {
public static void main(String[] args) throws InterruptedException {
DateFormat format = new SimpleDateFormat("HH:mm:ss");
Thread printThread = new Thread(new Runner(), "printThread");
printThread.setDaemon(true);
printThread.start();
TimeUnit.SECONDS.sleep(3);
printThread.suspend(); // 线程暂停
System.out.println("main suspend PrintThread at " + format.format(new Date()));
TimeUnit.SECONDS.sleep(3);
printThread.resume(); // 线程恢复
System.out.println("main resume PrintThread at " + format.format(new Date()));
TimeUnit.SECONDS.sleep(3);
printThread.stop(); // 线程停止
System.out.println("main stop PrintThread at " + format.format(new Date()));
TimeUnit.SECONDS.sleep(3);
}
static class Runner implements Runnable {
@Override
public void run() {
DateFormat format = new SimpleDateFormat("HH:mm:ss");
while (true) {
System.out.println(Thread.currentThread().getName() + " Run at " + format.format(new Date()));
SleepUtils.second(1);
}
}
}
}
================================================
FILE: src/main/java/com/art/concurrency/ch04/Interrupted.java
================================================
package com.art.concurrency.ch04;
import com.art.concurrency.utils.SleepUtils;
import java.util.concurrent.TimeUnit;
public class Interrupted {
public static void main(String[] args) throws InterruptedException {
Thread sleepRunner = new Thread(new SleepRunner(), "SleepRunner");
sleepRunner.setDaemon(true);
Thread busyRunner = new Thread(new BusyRunner(), "BusyRunner");
busyRunner.setDaemon(true);
sleepRunner.start();
busyRunner.start();
TimeUnit.SECONDS.sleep(5);
sleepRunner.interrupt();
busyRunner.interrupt();
System.out.println("SleepThread interrupted is " + sleepRunner.isInterrupted());
System.out.println("BusyThread interrupted is " + busyRunner.isInterrupted());
SleepUtils.second(2);
}
static class SleepRunner implements Runnable {
@Override
public void run() {
while (true) {
SleepUtils.second(10);
}
}
}
static class BusyRunner implements Runnable {
@Override
public void run() {
while (true) {
}
}
}
}
================================================
FILE: src/main/java/com/art/concurrency/ch04/MultiThread.java
================================================
package com.art.concurrency.ch04;
import java.lang.management.ManagementFactory;
import java.lang.management.ThreadInfo;
import java.lang.management.ThreadMXBean;
public class MultiThread {
public static void main(String[] args) {
ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();
ThreadInfo[] threadInfos = threadMXBean.dumpAllThreads(false, false);
for (ThreadInfo threadInfo : threadInfos) {
System.out.println("[" + threadInfo.getThreadId() + "] " + threadInfo.getThreadName());
}
}
}
================================================
FILE: src/main/java/com/art/concurrency/ch04/Priority.java
================================================
package com.art.concurrency.ch04;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
public class Priority {
private static volatile boolean notStart = true;
private static volatile boolean notEnd = true;
public static void main(String[] args) throws InterruptedException {
List<Job> jobs = new ArrayList<>();
for (int i = 0; i < 10; i++) {
int priority = i < 5 ? Thread.MIN_PRIORITY : Thread.MAX_PRIORITY;
Job job = new Job(priority);
jobs.add(job);
Thread thread = new Thread(job, "thread:" + i);
thread.setPriority(priority);
thread.start();
}
notStart = false;
TimeUnit.SECONDS.sleep(10);
notEnd = false;
for (Job job : jobs) {
System.out.println("Job Priority:" + job.priority + ", Count : " + job.jobCount);
}
}
static class Job implements Runnable {
private int priority;
private long jobCount;
public Job() {
}
public Job(int priority) {
this.priority = priority;
}
public Job(int priority, long jobCount) {
this(priority);
this.jobCount = jobCount;
}
@Override
public void run() {
while (notStart) {
Thread.yield();
}
while (notEnd) {
Thread.yield();
jobCount++;
}
}
}
}
================================================
FILE: src/main/java/com/art/concurrency/ch04/Shutdown.java
================================================
package com.art.concurrency.ch04;
import java.util.concurrent.TimeUnit;
public class Shutdown {
public static void main(String[] args) throws InterruptedException {
Runner one = new Runner();
Thread countThead = new Thread(one, "CountThread");
countThead.start();
TimeUnit.SECONDS.sleep(1);
countThead.interrupt();
Runner two = new Runner();
countThead = new Thread(two, "CountThread");
countThead.start();
TimeUnit.SECONDS.sleep(1);
two.cancel();
}
static class Runner implements Runnable {
private long i;
private volatile boolean on = true;
@Override
public void run() {
while (on && !Thread.currentThread().isInterrupted()) {
i ++;
}
System.out.println("Count i = " + i);
}
public void cancel() {
on = false;
}
}
}
================================================
FILE: src/main/java/com/art/concurrency/ch04/ThreadState.java
================================================
package com.art.concurrency.ch04;
import com.art.concurrency.utils.SleepUtils;
/**
* https://docs.oracle.com/javase/8/docs/api/index.html
*/
public class ThreadState {
public static void main(String[] args) {
Thread.State[] values = Thread.State.values();
System.out.println(values);
new Thread(new TimeWaiting(), "TimeWaitingThread").start();
new Thread(new Waiting(), "WaitingThread").start();
new Thread(new Blocked(), "BlockedThread-1").start();
new Thread(new Blocked(), "BlockedThread-2").start();
}
static class TimeWaiting implements Runnable {
@Override
public void run() {
SleepUtils.second(100);
}
}
static class Waiting implements Runnable {
@Override
public void run() {
while (true) {
synchronized (Waiting.class) {
try {
Waiting.class.wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
}
static class Blocked implements Runnable {
@Override
public void run() {
synchronized (Blocked.class) {
while (true) {
SleepUtils.second(100);
}
}
}
}
}
================================================
FILE: src/main/java/com/art/concurrency/ch08/BankWaterService.java
================================================
package com.art.concurrency.ch08;
import java.util.Map;
import java.util.concurrent.*;
public class BankWaterService implements Runnable {
/**
* 创建四个屏障,处理完之后执行当前类的run方法
*/
private CyclicBarrier cyclicBarrier = new CyclicBarrier(4, this);
/**
* 假设只有四个 sheet 页,所以启动 4 个线程
*/
private Executor executor = Executors.newFixedThreadPool(4);
/**
* 保存每个 sheet 计算出的银行流水结果
*/
private ConcurrentHashMap<String, Integer> sheetBankWaterCount = new ConcurrentHashMap<>();
private void count() {
for (int i = 0; i < 4; i++) {
executor.execute(new Runnable() {
@Override
public void run() {
// 计算当前 sheet 的银流数据
sheetBankWaterCount.put(Thread.currentThread().getName(), 1);
try {
// 计算完成,插入一个屏障
cyclicBarrier.await();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (BrokenBarrierException e) {
e.printStackTrace();
}
}
});
}
}
@Override
public void run() {
int result = 0;
// 汇总每个 sheet 计算出来的结果
for (Map.Entry<String, Integer> sheet : sheetBankWaterCount.entrySet()) {
result += sheet.getValue();
}
// output
sheetBankWaterCount.put("result", result);
System.out.println(result);
}
public static void main(String[] args) {
BankWaterService bankWaterService = new BankWaterService();
bankWaterService.count();
}
}
================================================
FILE: src/main/java/com/art/concurrency/ch08/CountDownLatchTest.java
================================================
package com.art.concurrency.ch08;
import java.util.concurrent.CountDownLatch;
public class CountDownLatchTest {
// 10 个线程
static CountDownLatch countDownLatch = new CountDownLatch(10);
public static void main(String[] args) throws InterruptedException {
for (int i = 0; i < 10; i++) {
int threadNo = i;
new Thread(new Runnable() {
@Override
public void run() {
System.out.println("thread: " + threadNo);
// 执行完打印语句之后,count 数减一
countDownLatch.countDown();
}
}).start();
}
// 当 count 为0时,就可以执行以后的打印语句
countDownLatch.await();
System.out.println("all threads finished.");
}
}
================================================
FILE: src/main/java/com/art/concurrency/ch08/CyclicBarrierTest.java
================================================
package com.art.concurrency.ch08;
import java.util.concurrent.BrokenBarrierException;
import java.util.concurrent.CyclicBarrier;
/**
* CyclicBarrier 可用于多线程计算数据,最后合并计算结果的场景。
*/
public class CyclicBarrierTest {
static CyclicBarrier cyclicBarrier = new CyclicBarrier(2);
public static void main(String[] args) throws BrokenBarrierException, InterruptedException {
new Thread(new Runnable() {
@Override
public void run() {
try {
cyclicBarrier.await();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (BrokenBarrierException e) {
e.printStackTrace();
}
System.out.println(1);
}
}).start();
cyclicBarrier.await();
System.out.println(2);
}
}
================================================
FILE: src/main/java/com/art/concurrency/ch08/CyclicBarrierTest02.java
================================================
package com.art.concurrency.ch08;
import java.util.concurrent.BrokenBarrierException;
import java.util.concurrent.CyclicBarrier;
public class CyclicBarrierTest02 {
static CyclicBarrier cyclicBarrier = new CyclicBarrier(2, new A());
public static void main(String[] args) throws BrokenBarrierException, InterruptedException {
new Thread(new Runnable() {
@Override
public void run() {
try {
cyclicBarrier.await();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (BrokenBarrierException e) {
e.printStackTrace();
}
System.out.println(1);
}
}).start();
cyclicBarrier.await();
System.out.println(2);
}
static class A implements Runnable {
@Override
public void run() {
System.out.println(3);
}
}
}
================================================
FILE: src/main/java/com/art/concurrency/ch08/CyclicBarrierTest03.java
================================================
package com.art.concurrency.ch08;
import java.util.concurrent.BrokenBarrierException;
import java.util.concurrent.CyclicBarrier;
public class CyclicBarrierTest03 {
static CyclicBarrier cyclicBarrier = new CyclicBarrier(2);
public static void main(String[] args) {
Thread t = new Thread(new Runnable() {
@Override
public void run() {
try {
cyclicBarrier.await();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (BrokenBarrierException e) {
e.printStackTrace();
}
}
});
t.start();
t.interrupt();
try {
cyclicBarrier.await();
} catch (Exception e) {
System.out.println(cyclicBarrier.isBroken());
}
}
}
================================================
FILE: src/main/java/com/art/concurrency/ch08/ExchangerTest.java
================================================
package com.art.concurrency.ch08;
import java.util.concurrent.Exchanger;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
* 用户遗传算法
* 用于校对工作
*/
public class ExchangerTest {
private static final Exchanger<String> exgr = new Exchanger<>();
private static ExecutorService threadPool = Executors.newFixedThreadPool(2);
public static void main(String[] args) {
threadPool.execute(new Runnable() {
@Override
public void run() {
try {
String a = "银行流水A";
// 同步点,第一个线程执行exchange函数的时候,线程1会等待第二线程也执行 exchange 函数
String msg = exgr.exchange(a);
System.out.println("msg=" + msg);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
});
threadPool.execute(new Runnable() {
@Override
public void run() {
try {
String b = "银行流水B";
String a = exgr.exchange(b);
System.out.println("a与b数据是否一致:" + a.equals(b));
System.out.println("A=" + a);
System.out.println("B=" + b);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
});
threadPool.shutdown();
}
}
================================================
FILE: src/main/java/com/art/concurrency/ch08/SemaphoreTest.java
================================================
package com.art.concurrency.ch08;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Semaphore;
/**
* 可以用作流量控制,特别是公用资源有限的应用场景,如数据库连接。
* 有一个需求,要读取几万个文件的数据,因为是IO密集型任务,我们可以启动几十个线程并发读取
* 但是如果读到内存后,还需要存储到数据库中,而且数据库的连接的连接数只有10个,这时我们必
* 须控制只有10个线程同时获取数据库连接保存数据,否则无法获取数据库连接。
*/
public class SemaphoreTest {
private static final int THREAD_COUNT = 30;
private static ExecutorService threadPool = Executors.newFixedThreadPool(THREAD_COUNT);
/**
* 最大并发数 10
*/
private static Semaphore s = new Semaphore(10);
public static void main(String[] args) {
for (int i = 0; i < THREAD_COUNT; i++) {
threadPool.execute(new Runnable() {
@Override
public void run() {
try {
s.acquire();
System.out.println("save data.");
s.release();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
});
}
threadPool.shutdown();
}
}
================================================
FILE: src/main/java/com/art/concurrency/utils/SleepUtils.java
================================================
package com.art.concurrency.utils;
import java.util.concurrent.TimeUnit;
public class SleepUtils {
public static final void second(long seconds) {
try {
TimeUnit.SECONDS.sleep(seconds);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
================================================
FILE: src/main/java/com/basic/alibaba/BigDecimalTest.java
================================================
package com.basic.alibaba;
import java.math.BigDecimal;
/**
* @description alibaba
* @author shenjy
* @since 2019/08/04
*/
public class BigDecimalTest {
public static void main(String[] args) {
BigDecimal a = new BigDecimal(0.1);
System.out.println(a);
// 推荐使用
BigDecimal b = new BigDecimal("0.1");
System.out.println(b);
}
}
================================================
FILE: src/main/java/com/basic/alibaba/CollectionTest.java
================================================
package com.basic.alibaba;
/**
* 集合处理
*
* @author MarkShen1992
* @since 20200509
*/
public class CollectionTest {
/*
public static void main(String[] args) {
List<String> strings = new ArrayList<>();
// 判断所有集合内部的元素是否为空,使用 isEmpty()方法
if (strings.isEmpty()) {
System.out.println("集合 strings 为空...");
}
strings.add("1");
strings.add("2");
strings.add("3");
List<String> strings1 = strings.subList(0, 2);
strings1.forEach(System.out::println);
// ArrayList 的 subList 结果不可强转成 ArrayList
// java.lang.ClassCastException: java.util.ArrayList$SubList cannot be cast to java.util.ArrayList
// ArrayList<String> arrayList = (ArrayList<String>) strings1;
// java.lang.UnsupportedOperationException, Returns an empty list (immutable).
List<Integer> ints = Collections.emptyList();
// ints.add(1);
List<Pair<String, Double>> pairArrayList = new ArrayList<>(3);
pairArrayList.add(new Pair<>("version", 6.19));
pairArrayList.add(new Pair<>("version", 10.24));
// 在使用 java.util.stream.Collectors 类的 toMap()方法转为 Map 集合时,一定要注意当 value 为 null 时会抛 NPE 异常
// pairArrayList.add(new Pair<>("version", null));
Map<String, Double> map = pairArrayList.stream().collect(
// 生成的 map 集合中只有一个键值对:{version=13.14}
Collectors.toMap(Pair::getKey, Pair::getValue, (v1, v2) -> v2));
List<String> list = new ArrayList<>(2);
list.add("guan");
list.add("bao");
String[] array = list.toArray(new String[0]);
int length = array.length;
System.out.println(length);
// 在使用 Collection 接口任何实现类的 addAll()方法时,都要对输入的集合参数进行 NPE 判断
//
Long[] longArr = new Long[] { 1L, 2L, 3L, 4L, 5L, 6L };
List<Long> longs = Arrays.asList(longArr);
// longs.add(7L);
longArr[0] = 11L;
// PECS(Producer Extends Consumer Super)原则
// https://itimetraveler.github.io/2016/12/27/%E3%80%90Java%E3%80%91%E6%B3%9B%E5%9E%8B%E4%B8%AD%20extends%20%E5%92%8C%20super%20%E7%9A%84%E5%8C%BA%E5%88%AB%EF%BC%9F/
// 不要在 foreach 循环里进行元素的 remove/add 操作。remove 元素请使用 Iterator
// 方式,如果并发操作,需要对 Iterator 对象加锁。
List<String> list2 = new ArrayList<>();
list2.add("1");
list2.add("2");
Iterator<String> iterator = list2.iterator();
while (iterator.hasNext()) {
String item = iterator.next();
if (item.length() > 0) {
iterator.remove();
}
}
}
*/
}
================================================
FILE: src/main/java/com/basic/alibaba/ConfusingName.java
================================================
package com.basic.alibaba;
/**
* @author MarkShen1992
* @since 2020.4.29
*/
public class ConfusingName {
public int stock;
private boolean condition;
// 非 setter/getter 的参数名称,不允许与本类成员变量同名
public void get(String alibaba) {
if (condition) {
final int money = 666;
}
for (int i = 0; i < 10; i++) {
// 在同一方法体中,不允许与其它代码块中的 money 命名相同
final int money = 15978;
}
}
}
class Son extends ConfusingName {
public int stock;
}
================================================
FILE: src/main/java/com/basic/alibaba/DateTest.java
================================================
package com.basic.alibaba;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.Date;
/**
* 日期时间规约
*
* @author MarkShen1992
* @since 20200508
*/
public class DateTest {
private final static String PATTERN = "yyyy-MM-dd HH:mm:ss";
/**
* 月
*/
private final static int MONTH = 1;
/**
* 日
*/
private final static int DAY = 1;
public static void main(String[] args) {
String time = "2023-01-04T00:00:00";
System.out.println(time.split("T")[0].replace("-", "/"));
DateFormat dateFormat = new SimpleDateFormat(PATTERN);
System.out.println(dateFormat.format(new Date()));
// 获取当前毫秒数
System.out.println(System.currentTimeMillis());
// 纳秒
System.out.println(System.nanoTime());
// 统计时间等场景
// Instant
// 获取今年的天数
int daysOfThisYear = LocalDate.now().lengthOfYear();
System.out.println(daysOfThisYear);
// 获取指定某年的天数
System.out.println(getDaysOfCurrentYear(2016));
}
private static int getDaysOfCurrentYear(int currentYear) {
return LocalDate.of(currentYear, MONTH, DAY).lengthOfYear();
}
}
================================================
FILE: src/main/java/com/basic/alibaba/FloatPrimitiveTest.java
================================================
package com.basic.alibaba;
/**
* @description alibaba
* @author shenjy
* @since 2019/08/04
*/
public class FloatPrimitiveTest {
public static void main(String[] args) {
float a = 1.0f - 0.9f;
float b = 0.9f - 0.8f;
if (a == b) {
System.out.println("true");
} else {
System.out.println("false");
}
}
}
================================================
FILE: src/main/java/com/basic/alibaba/FloatWrapTest.java
================================================
package com.basic.alibaba;
/**
* @description alibaba
* @author shenjy
* @since 2019/08/04
*/
public class FloatWrapTest {
public static void main(String[] args) {
Float a = Float.valueOf(1.0f - 0.9f);
Float b = Float.valueOf(0.9f - 0.8f);
if (a == b) {
System.out.println("true");
} else {
System.out.println("false");
}
}
}
================================================
FILE: src/main/java/com/basic/alibaba/IntegerCacheTest.java
================================================
package com.basic.alibaba;
/**
* IntegerCacheTest
*
* @author MarkShen1992
* @since 2020.5.1
*/
public class IntegerCacheTest {
public static void main(String[] args) {
Integer aa = 127;
Integer bb = 127;
System.out.println(aa.equals(bb));
System.out.println(aa == bb);
Integer a = 128;
Integer b = 128;
System.out.println(a == b);
System.out.println(a.equals(b));
int aaa = 128;
int bbb = 128;
System.out.println(aaa == bbb);
Integer c = null;
Boolean flag = false;
// a*b 的结果是 int 类型,那么 c 会强制拆箱成 int 类型,抛出 NPE 异常
Integer result = (flag ? a * b : c);
}
}
================================================
FILE: src/main/java/com/basic/alibaba/LockTest.java
================================================
package com.basic.alibaba;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
/**
* @description alibaba
* @author shenjy
* @since 2019/08/04
*/
public class LockTest {
private final static Lock lock = new ReentrantLock();
public static void main(String[] args) {
try {
lock.tryLock();
} catch (Exception e) {
e.printStackTrace();
} finally {
lock.unlock();
}
}
}
================================================
FILE: src/main/java/com/basic/alibaba/PrimitiveTypeArrayMaxSizeTest.java
================================================
package com.basic.alibaba;
/**
* C:\Users\shenjy>java -version java version "1.8.0_112" Java(TM) SE Runtime Environment (build 1.8.0_112-b15) Java
* HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)
*/
public class PrimitiveTypeArrayMaxSizeTest {
public static void main(String[] args) {
// JVM 学习站点:
// 1. http://lovestblog.cn/
// 2. https://opts.console.heapdump.cn/
// 3. https://heapdump.cn/
// 注意:这里使用的虚拟机参数:-Xms9g -Xmx9g
// Xms: 初始化时候堆大小
// Xmx: 程序运行时堆大小
// char[] chars = new char[Integer.MAX_VALUE - 2];
// System.out.println(chars.length);
// byte[] bytes = new byte[Integer.MAX_VALUE - 2];
// System.out.println(bytes.length);
// short[] shorts = new short[Integer.MAX_VALUE - 2];
// System.out.println(shorts.length);
// int[] ints = new int[Integer.MAX_VALUE - 715784195];
// System.out.println(ints.length);
// long[] longs = new long[Integer.MAX_VALUE - 1431633921];
// System.out.println(longs.length);
// float[] floats = new float[Integer.MAX_VALUE - 715784195];
// System.out.println(floats.length);
// double[] doubles = new double[Integer.MAX_VALUE - 1431633921];
// System.out.println(doubles.length);
boolean[] booleans = new boolean[Integer.MAX_VALUE - 2];
System.out.println(booleans.length);
}
}
================================================
FILE: src/main/java/com/basic/alibaba/SwitchTest.java
================================================
package com.basic.alibaba;
/**
* @description alibaba
* @author shenjy
* @since 2019/08/04
*/
public class SwitchTest {
public static void main(String[] args) {
String param = null;
switch (param) {
case "null":
System.out.println("null");
break;
default:
System.out.println("default");
}
}
}
================================================
FILE: src/main/java/com/basic/alibaba/package-info.java
================================================
package com.basic.alibaba;
/**
* @link https://developer.aliyun.com/special/tech-java
* 优雅性,可扩展性,可读性
* 分布式事务,分布式消息队列
* 在POJO类里面,方法参数推荐使用包装数据类型,数值计算使用基本数据类型
* 代码质量的度量指标:可读性,可扩展性,可维护性
* 符合开发规范,最合适的地方用最恰当的类的最恰当的方法去处理业务,算法的复杂度,考虑算法的调用频率
* p3c idea插件, eclipse插件
*
* 广度和深度
* 首先拓宽自己的广度,然后选择自己擅长的领域去搞
* 推荐读 JDK源码,熟读 API
* Dubbo, RocketMQ => 高并发,高可用,分布式
* 多写写原型,像Dubbo原型, RocketMQ原型等
* 保持技术的敏感性,对代码的敏感性
* 修改的代码越多,可扩展性越差
*
* (奉献式)热爱,(极致)卓越,思考(主动)
*/
================================================
FILE: src/main/java/com/basic/chapter0100/Chapter0100Introduction.java
================================================
package com.basic.chapter0100;
/**
* 简介
* 读书怎么读:看一个大概,直接用,用的时候回来再查
* JDK安装后,看下JDK安装目录
* @author MarkShen1992
* @since 20191101
*/
public class Chapter0100Introduction {
public static void main(String[] args) {
/**
* SCM系统
* 电信宽带运营平台
* 远程教学平台
* VOD
* 视频监控
* 可视电话
* ERP
* 视频会议
* 新闻发布系统
* 网上商城,电子商务
* 移动增值平台
*/
/**
* 课程内容:
* Java基础
* 语法基础
* OO
* Exception
* Array
* 基础类
* I/O stream
* Collection/Generic
* Thread
* TCP/UDP
* GUI
* MetaData(EJB3.0)
* RegExp
* 沟通的时候,当你说任何话的时候站在对方角度上考虑下,看他能不能接受
* 没事的时候,多看看数据结构的内容,算法,设计模式
* 数据库的知识
* html,css, javascript, JSP, Servlet
* 框架选择,技术选型
* Java Web开发框架
* Hibernate, Mybatis, JPO(掌握原理,算法+数据结构)
* 学新东西是件好事儿
* EJB3.0的课程,EJB2.0
* 在招聘网站搜索,招某些职位的量
* 铺网络,上应用
* 教学方法:
* 巨无霸式教学
* 理论
* 举例
* 理论回顾
* 联系
* 讲解
* 注重结合工程实践
* 注重传授自学能力
*
* 时间短,强度大,这个时候要背一些东西的时候还是要背些内容的
*
* 能力的三个层次:
* 1. 知识:(接受能力)
* 学习前人的东西
* 2. 解决问题的方法:(碰见什么问题,用什么方法)
* 灵活运用学到的东西
* 3. 解决问题的思路:(掌握解决问题的思路,拓展一条思路)
* 创造解决问题的方法
* 灵活一点儿,再灵活一点
*
* 学习方法;
* 看算法那本书
* 完成习题
* 运用自学的能力
* 读,写,查,背(*对底子比较薄的同学)
*
* 预备知识:
* 英语
* 计算机基本操作
* 正向的暗示
* Google + 电驴
* 软件行业认证:
* 现在开始别听别人忽悠,别听任何人忽悠,别听我忽悠
* 用自己的脑子去认识这个世界
*
* 国外比较认软件认证:Oracle认证,CCIE(Cisco Certified Internetwork Expert)
* 考含金量比较高的认证
* ERP咨询师
* SAP咨询师
* 共享软件,everything
* 努力,勤奋
* 琢磨人,总是要多走一步;走一步看三步,随时留意一些细节
* 身体:
* 腰椎,颈椎,手腕
*
* 教学资源:
*
* 企业与学校之间的区别
* 时限
* 使用为主
*
* 知识分类:
* 实际开发过程中经常要用的知识(牢牢掌握)
* 不经常使用用时就可以查到(了解)
* 八辈子用不到的知识(运用自己的能里去查)
*
* 管理好自己的精力
* 乐观的努力
* 眼光要高远一点儿
* 脚步要踏实
*
* 问题(老师)
* 讲的多,练习时间少
* 只灌输知识点,没有串联
* 不培养自学能力
* 给答案不给思路
* 项目太简单
* 项目太复杂
* 项目太少
* 注重技巧,不重视基本功
* 种管理技巧,请开发技巧
* 知识太旧了
*
* 技术 + 行业知识
* 进销存系统
*
* Java是解释型语言
* 分层思想
*
* 读书怎么读:看一个大概,直接用,用的时候回来再查
*/
System.out.println("Hello world!");
}
}
================================================
FILE: src/main/java/com/basic/chapter0100/Chapter0101Identifier.java
================================================
package com.basic.chapter0100;
/**
* 标识符
* @author MarkShen1992
* @since 20191101
*/
public class Chapter0101Identifier {
public static void main(String[] args) {
/**
* 各种变量,类名,方法名
*
* 标识符规则
* 标识符由字母,下划线,数字,美元符号组成
* 标识符由字母,下划线,美元符号开头
* Java标识符大小写敏感,长度无限制
*
* 起名字规则:"见名知意",且不能与Java关键词冲突
**/
int result = 10 + 10;
System.out.println("hello world, " + result);
}
}
================================================
FILE: src/main/java/com/basic/chapter0100/Chapter0102JavaKeyWord.java
================================================
package com.basic.chapter0100;
/**
* 关键字
* @author MarkShen1992
* @since 20191101
*/
public class Chapter0102JavaKeyWord {
public static void main(String[] args) {
/**
* Java关键字见文章:
* https://docs.oracle.com/javase/tutorial/java/nutsandbolts/_keywords.html
*/
System.out.println("keyword...");
}
}
================================================
FILE: src/main/java/com/basic/chapter0100/Chapter0103ConstantAndVariable.java
================================================
package com.basic.chapter0100;
/**
* 常量与变量
* @author MarkShen1992
* @since 20191101
*/
public class Chapter0103ConstantAndVariable {
public static void main(String[] args) {
/**
* 从本质上讲,变量其实就是内存中的一小块区域,使用变量名来访问这块区域,
* 因此,每一个变量使用前必须要先声明(申请内存),然后进行赋值(填充内容),才可以使用。
* 不同数据类型所占内存空间不同。
*/
int num = 123; // 所在位置,栈内存
double d = 3.14;
char ch = 'a';
boolean flag = true;
String str = "Hello world!";
// 不可变的变量,类似于C语言中的 const 修饰的量,与Java中的 final 对应
final int var = 10;
float PI = 3.14f;
// 下面注释掉的这句话会有编译错误
// var = 12;
/**
* 重点内容:******
* 程序的执行过程:《深入Java虚拟机》,可以找官方英文版
* .exe文件放到操作系统直接执行;.class放到JVM中执行
* 程序首先从硬盘加载(load)到内存区域中
* 然后,操作系统会找到加载到内存中程序的main方法
* 然后,执行过程中的内存管理
* 内存管理中,在程序运行的时候,内存分为4个部分,不同操作系统不同
* 分别是:堆,栈,代码区,方法区
* 堆(Heap):Java代码new出来的东西
* 栈(Stack):局部变量
* 代码区(Code segment):存放代码
* 数据区(Data segment):静态变量,字符串变量
*/
}
}
================================================
FILE: src/main/java/com/basic/chapter0100/Chapter0104TestVar.java
================================================
package com.basic.chapter0100;
/**
* 敲程序方法:在看懂整个程序的意思后,背着把程序敲出来;
* 或者有自己的理解后,自己组织程序结构完成程序。
* @author MarkShen1992
* @since 20191102
*/
public class Chapter0104TestVar {
static int j;
public void m() {
int i = 0;
System.out.println(i);
}
public static void main(String[] args) {
int i = 0;
System.out.println(i);
System.out.println(j);
boolean b = false;
if(b) {
int c = 0;
System.out.println("b is true");
}
// System.out.println(c);
long longNum1 = 8888888888888L;
}
}
================================================
FILE: src/main/java/com/basic/chapter0100/Chapter0104TestVar2.java
================================================
package com.basic.chapter0100;
/**
* 数据类型测试
* @author MarkShen1992
* @since 20191102
*/
public class Chapter0104TestVar2 {
public static void main(String[] args) {
boolean b = true;
int x, y = 9;
double d = 3.1415;
char c1, c2;
c1 = '\u534e';
c2 = 'c';
x = 12;
System.out.println("b=" + b);
System.out.println("x=" + x + ",y=" + y);
System.out.println("d=" + d);
System.out.println("c1=" + c1);
System.out.println("c2=" + c2);
}
}
================================================
FILE: src/main/java/com/basic/chapter0100/Chapter0104VariableType.java
================================================
package com.basic.chapter0100;
/**
* 变量分类
* @author MarkShen1992
* @since 20191101
*/
public class Chapter0104VariableType {
// 成员变量
static int a; // 成员变量如何初始化的?在什么时候初始化的?
public static void main(String[] args) {
/**
* 按被声明的位置划分:
* 成员变量:方法外部,类内部定义的变量
* 局部变量:方法或语句块内部定义的变量
* 注意:类外不能声明变量, 方法的参数叫做局部变量
*
* 按所属数据类型划分:
* 基本数据类型
* 引用类型
*/
// 局部变量
int b = 10;
System.out.println(a);
System.out.println(b);
/**
* 变量作用域:在大括号里面声明的变量出了大括号之后就没有人认识它了
*/
}
}
================================================
FILE: src/main/java/com/basic/chapter0100/Chapter0105DataType.java
================================================
package com.basic.chapter0100;
/**
* 数据类型
* @author MarkShen1992
* @since 20191102
*/
public class Chapter0105DataType {
public static void main(String[] args) {
/**
* 基本数据类型:
* 数值型:
* 整数类型:byte, short, int, long
* 浮点类型:float, double
* 字符型(文本):char
* Java里面采用Unicode编码,每个字符占两个字节,因而可使用十六进制编码形式表示。
* XML中编码问题
* 每种不同的文字,在计算机中表示为010101...
* 每个字节8位
* 中文编码问题
* Unicode一统江湖,统一了全世界所有编码
* https://en.wikipedia.org/wiki/Unicode 需要科学上网
* 布尔型(逻辑):boolean
*
* 内存大小,小格的布局
* Java各个整数类型有固定的表数范围和字段长度,其不受具体操作系统影响,可以在各个平台移植。
*/
/**
* In Oracle’s Java Virtual Machine implementation, boolean arrays in the Java
* programming language are encoded as Java Virtual Machine byte arrays, using 8 bits per
* boolean element.
* -- 《JVM官方文档》
*/
boolean flag = true;
if (flag) {
System.out.println("flag is valid.");
}
// 字符型, 占两个字节
char c = 'a';
System.out.println(c);
/**
* 数类型, 占用内存1个字节, 1byte
* Java语言整型常量的三种表示
* 十进制
* 八进制:编码算法中使用,012
* 十六进制
*
* Java语言整形常量默认为int类型
*/
byte by = 123;
System.out.println(by);
// 2 bytes
short sh = 123;
System.out.println(sh);
// 4 bytes
int num = 123;
System.out.println(num);
// 8 bytes
long lon = 1234L;
System.out.println(lon);
/**
* 浮点类型:浮点数在计算机中的表示,浮点数是有一定的误差的
* float, double
* 浮点数默认为 double类型
*/
// 8 bytes
double PI = 3.14;
System.out.println(PI);
// 4 bytes, 精度
float PI2 = 3.14f;
// float PI2 = 3.14F;
System.out.println(PI2);
/**
* 引用数据类型:
* 类(class)
* 接口(interface)
* 数组(array)
*/
}
}
================================================
FILE: src/main/java/com/basic/chapter0100/Chapter0106BasicDataTypeConvertPrinciple.java
================================================
package com.basic.chapter0100;
/**
* 基本数据类型转换
* @author MarkShen1992
* @since 20191102
*/
public class Chapter0106BasicDataTypeConvertPrinciple {
public static void main(String[] args) {
/**
* 整形,浮点型,字符型的数据在混合运算中相互转换,原则如下:
* 1)容量小的数据类型自动转换为容量大的数据类型,数据类型按容量大小(表示的数的大小)排序:
* byte, short, char -> int -> long -> float -> double
* byte, short, char之间不会相互转换,他们三者在计算前要先转换为 int.
* 2)容量大的数据类型转换为容量小的数据类型时,要加上强制转换符,但可能造成
* 精度降低或溢出
* 3)有多种数据类型的数据进行混合运算时,系统首先自动将所有数据转换成容量最大
* 的那一种数据类型,然后再进行计算
* 4)实数类型默认为 double
* 5)证书类型默认为 int
*/
}
}
================================================
FILE: src/main/java/com/basic/chapter0100/Chapter0106TestConvert.java
================================================
package com.basic.chapter0100;
/**
* 练习程序
* @author MarkShen1992
* @since 20191102
*/
public class Chapter0106TestConvert {
public static void main(String arg[]) {
int i1 = 123;
int i2 = 456;
double d1 = (i1 + i2) * 1.2;// 系统将转换double型进行运算
float f1 = (float) ((i1 + i2) * 1.2);// 需要加强制转换符号
byte b1 = 67;
byte b2 = 89;
byte b3 = (byte) (b1 + b2);// 系统将转换为 int 进行运算,然后再转换回来
System.out.println(b3);
double d2 = 1e200;
float f2 = (float) d2;// 产生溢出
System.out.println(f2);
float f3 = 1.23f;// 必须加f, 浮点数直接砍掉是不可以的
long l1 = 123;
long l2 = 30000000000L;// 必须加L
float f = l1 + l2 + f3;// 系统将转换float型计算
long l = (long) f;// 强制转换会舍去小数部分(非四舍五入)
}
}
================================================
FILE: src/main/java/com/basic/chapter0100/Chapter0106TestConvert2.java
================================================
package com.basic.chapter0100;
public class Chapter0106TestConvert2 {
public static void main(String[] args) {
int i = 1, j = 12;
float f1 = (float) 0.1; //0.1f
float f2 = 123;
long l1 = 12345678, l2 = 8888888888L;
double d1 = 2e20, d2 = 124;
byte b1 = 1, b2 = 2, b3 = 127;
j = j + 10;
i = i / 10;
// i = i * 0.1;
i = (int) (i * 0.1);
char c1 = 'a', c2 = 125;
byte b = (byte) (b1 - b2);
char c = (char) (c1 + c2 - 1);
float f3 = f1 + f2;
float f4 = (float) (f1 + f2 * 0.1);
double d = d1 * i + j;
float f = (float) (d1 * 5 + d2);
}
}
================================================
FILE: src/main/java/com/basic/chapter0100/Chapter0107TestIF.java
================================================
package com.basic.chapter0100;
/**
* if 表达式
* @author MarkShen1992
* @since 20191103
*/
public class Chapter0107TestIF {
public static void main(String[] args) {
int i = 20;
if (i < 20) {
System.out.println("<20");
System.out.println("<20");
} else if (i < 40) {
System.out.println("<40");
} else if (i < 60) {
System.out.println("<60");
} else
// 当if...else...语句中只有一个语句,可以省略大括号,不推荐使用
System.out.println(">=60");
System.out.println(">=60");
}
}
================================================
FILE: src/main/java/com/basic/chapter0100/Chapter0108For.java
================================================
package com.basic.chapter0100;
/**
* for语句, 计算1到 100这100个数之和
* foreach语句打印
* 分析算法时候,分析内存,找到规律。分析别人的算法,多分析别人的程序
* 多读别人的程序,提炼一些好的算法,算法慢慢积累,多看看数学
*
* @author MarkShen1992
* @since 20191103
*/
public class Chapter0108For {
public static void main(String[] args) {
long result = 0;
for (int i = 1; i <= 100; i ++) {
result += i;
}
System.out.println("result=" + result);
foreachTest();
System.out.println("factorial = " + factorialCompute(3));
System.out.println(factorialRecursion(3));
}
/**
* print the array elements
*/
public static void foreachTest() {
int[] arr = {1, 2, 3, 4};
for (int number : arr) {
System.out.println(number);
}
}
/**
* 计算 factorial 的阶乘, 1! + 2! + 3! + ... + factorial!
*
* @param factorial
* @return
*/
public static int factorialCompute(int factorial) {
// 好的编程习惯,要对传进来的参数进行判断
if (factorial <= 0) {
return 0;
}
// 最终的一结果
int result = 0;
// 临时变量存数
int tmpNum = 1;
for (int i = 1; i <= factorial; i++) {
tmpNum *= i;
result += tmpNum;
}
return result;
}
/**
* 递归实现阶乘
*
* @param factorial
* @return
*/
public static int factorialRecursion(int factorial) {
if (factorial <= 0) {
return 0;
}
if (factorial == 1) {
return 1;
}
return factorial * factorialRecursion(-- factorial);
}
}
================================================
FILE: src/main/java/com/basic/chapter0100/Chapter0109TestWhile.java
================================================
package com.basic.chapter0100;
/**
* while
* do...while
*
* @author MarkShen1992
* @since 20191103
*/
public class Chapter0109TestWhile {
public static void main(String[] args) {
int i = 0;
while (i < 10) {
System.out.println(i);
i++;
}
i = 0;
do {
i++;
System.out.println(i);
} while (i < 10);
}
}
================================================
FILE: src/main/java/com/basic/chapter0100/Chapter0110TestBreakAndContinue.java
================================================
package com.basic.chapter0100;
/**
* break
* continue
*
* @author MarkShen1992
* @since 20191103
*/
public class Chapter0110TestBreakAndContinue {
public static void main(String[] args) {
breakTest();
continueTest();
}
private static void continueTest() {
for (int i = 0; i < 10; i ++) {
if (i == 6) continue;
System.out.println(i);
}
}
private static void breakTest() {
for (int i = 0; i < 10; i ++) {
if (i == 6) break;
System.out.println(i);
}
}
}
================================================
FILE: src/main/java/com/basic/chapter0100/Chapter0111TestSwitch.java
================================================
package com.basic.chapter0100;
/**
* switch
* @author MarkShen1992
* @since 20191103
*/
public class Chapter0111TestSwitch {
public static void main(String[] args) {
int i = 8;
switch(i) {
// 多个case可以合并到一起
case 8 :
case 3 :
case 2 :
System.out.println("C");
break;
case 9 :
System.out.println("D");
break;
default: // default 可以省略,但是不建议
System.out.println("error");
}
// JDK7 new feature 语法
String condition = "abc";
switch(condition) {
case "abcd" :
System.out.println("abcd");
break; // 不加break,会产生case穿透问题
case "abc" :
System.out.println("abc");
break;
default:
System.out.println("1234");
}
}
}
================================================
FILE: src/main/java/com/basic/chapter0100/Chapter0112TestMethod.java
================================================
package com.basic.chapter0100;
/**
* 方法: 增强程序的复用性
*
* @author MarkShen1992
* @since 20191103
*/
public class Chapter0112TestMethod {
public static void main(String[] args) {
m();
m2(2);
m3('3', 4);
m4(4, 6);
int i = m4(4, 6);
System.out.println(i);
}
public static void m() {
// return;
System.out.println("ok");
System.out.println("hello");
}
public static void m2(int i) {
if (i > 3)
return;
System.out.println(i);
}
public static void m3(int i, int j) {
System.out.println(i + j);
}
public static int m4(int i, int j) {
return i > j ? i : j;
}
}
================================================
FILE: src/main/java/com/basic/chapter0100/Chapter0113TestMethod2.java
================================================
package com.basic.chapter0100;
/**
* method
* @author MarkShen1992
* @since 20191103
*/
public class Chapter0113TestMethod2 {
public int max(int a, int b) {
return a > b ? a : b;
}
public int min(int a, int b) {
return a < b ? a : b;
}
public static void main(String[] args) {
Chapter0113TestMethod2 t = new Chapter0113TestMethod2();
System.out.println("Max = " + t.max(3, 4));
System.out.println("Min = " + t.min(3, 4));
// System.out.println(Max(3, 4));
}
}
================================================
FILE: src/main/java/com/basic/chapter0100/Chapter0114Fab.java
================================================
package com.basic.chapter0100;
public class Chapter0114Fab {
public static void main(String[] args) {
System.out.println(f(-9));
}
public static long f(int index) {
if (index < 1) {
System.out.println("invalid parameter!");
return -1;
}
if (index == 1 || index == 2) {
return 1;
}
long f1 = 1L;
long f2 = 1L;
long f = 0;
for (int i = 0; i < index - 2; i++) {
f = f1 + f2;
f1 = f2;
f2 = f;
}
return f;
}
}
================================================
FILE: src/main/java/com/basic/chapter0100/Test01.java
================================================
package com.basic.chapter0100;
/**
* PPT中未敲完的程序
*
* @author MarkShen
* @since 20191207
*/
public class Test01 {
public static void main(String[] args) {
int i1 = 10, i2 = 20;
int i = i2 ++;
System.out.println("i=" + i);
System.out.println("i2=" + i2);
i = ++ i2;
System.out.println("i=" + i);
System.out.println("i2=" + i2);
i = -- i1;
System.out.println("i=" + i);
System.out.println("i1=" + i1);
i = i1 --;
System.out.println("i=" + i);
System.out.println("i1=" + i1);
}
}
================================================
FILE: src/main/java/com/basic/chapter0100/Test02.java
================================================
package com.basic.chapter0100;
/**
* PPT中未敲完的程序
*
* @author MarkShen
* @since 20191207
*/
public class Test02 {
public static void main(String[] args) {
boolean a, b, c;
a = true;
b = false;
c = a & b;
System.out.println("c=" + c);
c = a | b;
System.out.println("c=" + c);
c = a ^ b;
System.out.println("c=" + c);
c = !a;
System.out.println("c=" + c);
c = a && b;
System.out.println("c=" + c);
c = a || b;
System.out.println("c=" + c);
int i = 1, j = 2;
boolean flag1 = (i > 3) && ((i + j) > 5);
boolean flag2 = (i < 2) && ((i + j) < 6);
// 三目运算符号
int score = 80;
String result = score > 60 ? "及格" : "不及格";
System.out.println(result);
// fab
System.out.println(f(3));
}
public static int f(int n) {
if (n == 1 || n == 2) {
return 1;
} else {
return f(n - 1) + f(n - 2);
}
}
}
================================================
FILE: src/main/java/com/basic/chapter0200/Chapter0200Introduction.java
================================================
package com.basic.chapter0200;
/**
* 简介
* 指导性思想(极其重要)
* 第一步:考虑问题域中有哪些类,哪些对象
* 第二步:这些个类,这些个对象有哪些个属性
* 第三步:考虑类与类之间的关系,定他们之间的方法
*
* 分析问题域方法
* 类,成员变量(属性):找名词
* 方法(函数):找动词
*
* 万事万物皆对象
* 追求:
* 重用,可扩展性(多态),可维护性,面向组件(二进制级别抽象)的编程,WebService,SOA,COM
*
* @author MarkShen1992
* @since 20191104
*/
public class Chapter0200Introduction {
public static void main(String[] args) {
/**
* 编程语言的发展
* 面向过程设计思想
* 一切以我为中心
* 我第一步要干什么;
* 第二步要干什么;
* ......
*
* 面向对象设计思想
* 车 go(新疆),车怎么去,我不知道,最合适的方法应该出现在最合适的类里面,
* 车最知道自己的内部结构。在程序内,不在分解一步一步的过程,而是在问题域
* 里应该有哪些个对象,对象里面应该有哪些属性(静),哪些方法(动),对象
* 与对象之间的关系。
*
* 对象和类的概念
* 类是抽象的:具有某些特征的东西。一类事物的抽象。静态的属性
* 瓶子能倒水
* 对象是具体的,对应着数据库中的一条记录
*
* 类之间的关系
* 依赖 < 关联(我这个方法的参数是你这个类的对象) < 聚合 < 组合
* 为 设计模式 打基础
* 继承:...是一种..., extends
* 聚合:整体与局部的关系,...是...的一部分。
* 组合:密不可分,...是...必不可少的一部分。
* UML图
* 实现关系:implements
* 多态:
* 存在继承关系;
* 方法重写
* 父类引用指向子类对象
*
* 对象和引用
* 引用:Java语言中除基本类型之外的变量类型都称为引用类型。
* Java堆内存中的对象是通过栈内存中的引用对其操作的
* 占两块儿内存,堆内存,栈内存
*
* Java类的定义
* 构造函数(析构函数)
* public 类名() {}
* new 一个东西的时候要调用的方法,叫做构造方法。
* 一旦你自己重写构造方法,那么Java 编译器将不会为这个类添加默认的构造方法
* 所以,我们在new对象的时候,我们要做到的就是把那个无参的构造方法
* 手动加上
*
* 对象的创建和使用
* Object o = new Object();
* o.equals(new Object);
*
* this 关键字
* 当前对象
* this(String...) 对应的构造方法
* this.methodName 本类方法
*
* super 关键字
* 调用父类的内容
* super(String...) 对应父类构造函数
* super.methodName 父类方法
*
* static 关键字
* 类变量
* 类方法
*
* package 关键字
* 解决类名冲突的问题
* 命名:公司域名倒过来,默认为default包
* 包对应文件系统中的文件夹
* 根据业务分包
* 根据功能分包
* 如果向让别的人用你的类,首先要先用 import 关键字将其引入
*
* import 关键字
* 引入别的类库
*
* 访问控制 public protected private 友好
* 对于成员变量如下表:
* 修饰符 类内部 同一个包 子类 任何地方
* public Y N N N
* default Y Y N N
* protected Y Y Y N
* public Y Y Y Y
*
* 对于类来说
* public:任何地方都可以使用这个类
* default
*
* 类的继承 extends
* 特别注意下 protected 关键字
* 双亲委派机制
* 子类对象包含父类对象
*
* 方法的重写 @Override
* 从父类继承
* 相同的函数名称
* 相同的参数列表
* 相同的方法返回值
* 重写方法的时候要去父类copy, 也可以使用工具生成
* 重写的方法不可以使用比被重写方法更严格的访问权限
*
* final 关键字
* 类似于C语言中的 const
* 在内存中的 数据 区
* 被 final 修饰的变量不能被修改
* 成员变量
* 局部变量 (形参)
* final 的方法不能被重写
* final 的类不能被继承
*
* Object 类
* https://docs.oracle.com/javase/8/docs/
* Java 根基类
* 多看JavaAPI
* toString() 方法
* equals方法
*
* 对象转型
* 父类引用指向子类对象
* 一个基类的引用不可以访问其子类对象新加的成员(属性和方法)
* 可以使用 引用变量 instanceof 类名,来判断该引用类型变量所指向的对象是否
* 属于该类或该类的子类
* 子类的对象可以当作基类的对象来使用称上转型(upcasting),反之,称为下转型
*
* 扩展性比较好的例子:
* 当你建好这个建筑后,或者你写好这个程序之后,把主建筑建好了,将来要加一些
* 其他的功能,尽量不要去修改主结构,叫扩展性好
* 多看 经典建筑方面的书籍,比如巴黎圣母院的重新设计
*
* 亮了!巴黎圣母院的新塔尖设计方案
* http://dy.163.com/v2/article/detail/EET5G1F70528UJ6I.html
* https://zhuanlan.zhihu.com/p/77317713
*
* 多态
* 存在继承关系
* 方法重写
* 父类引用指向子类对象
* 实际中new的谁,就调用谁的方法,函数指针,动态绑定,核心中的核心
*
* 抽象类 Abstract
* 用 abstract 修饰的类为抽象类, 修饰的方法为 抽象方法
* 抽象方法没有必要实现
*
* // 相当于 C ++ 中的纯虚函数
* public abstract void method();
* 当一个类中有抽象方法的时候,那么这个类必须被声明为抽象类,抽象类
* 必须被继承,抽象方法必须被重写
* 抽象类不可以 new 出对象
* 抽象类只需声明,不需要实现
*
* 接口 interface implements
* 多个无关的类可以实现同一个接口
* 一个类可以实现多个无关的接口
* 与继承关系类似,接口与实现类之间存在多态性
*
* 接口是抽象方法和常量值的定义的集合,接口是一种特殊的抽象类,这种抽象类中
* 只包含常量和方法的定义,而没有变量和方法的实现。
*
* public static final int id = 1;
* 为什么要定义成 public static final 吗?为了修正 c++ 中多继承时候,容易
* 出现问题的地方。c++ 的多继承容易出现:类的多个父类之间,如果有相同的成员
* 变量的时候,引用起来相当麻烦,运行时候产生各种各样的问题。
*
* 接口的特性:
* 1. 接口可以多重实现
* 2. 接口中声明的属性默认为 public static final 的,也只能是 public static final的
* 3. 接口中只能定义抽象方法,这些接口默认为 public 的,也只能是 public 的
* 4. 接口可以继承其他接口,并添加新的属性和成员方法
*
* 接口中定义的方法:函数指针
*
*
* 总结:
* 1. 内存分析贯穿始终
* 2. 对象和类的概念
* 3. 类(对象)之间的关系
* 4. 面向对象设计思想
* 5. class
* 6. new
* 引用的概念
* 构造方法的概念
* 7. 方法重载
* 构造方法重载
* 8. this
* 9. super
* 10. static
* 11. package & import
* 12. private default protected public
* 13. extends
* 14. override
* 15. final
* 16. Object
* toString
* equals
* 17. upcasting downcasting
* 18. Polymorphism/dynamic binding/late
* 19. abstract class
* 20. interface
* implements
*/
}
}
================================================
FILE: src/main/java/com/basic/chapter0200/Chapter0201OO.java
================================================
package com.basic.chapter0200;
/**
*
* @author MarkShen1992
* @since 20191105
*/
public class Chapter0201OO {
public static void main(String[] args) {
/**
* 成员变量
* 可以是Java语言中的任何一种数据类型,基本类型和引用类型
* 在定义成员变量时可以直接对其初始化,如果不对其初始化,
* Java将使用默认的值进行初始化
* byte 0
* short 0
* int 0
* long 0L
* char '\u0000'
* float 0.0F
* double 0.0D
* boolean false
* 引用类型 null
*
* *成员变量在什么时候对其进行初始化,怎么初始化的?
*
* 局部变量:
* 声明 > 赋值 > 使用
*/
}
}
================================================
FILE: src/main/java/com/basic/chapter0200/Chapter0202ValueTransferAndReferenceTransfer.java
================================================
package com.basic.chapter0200;
/**
* 小程序分析内存,清楚理解值传递,引用传递
*
* 方法执行完毕,为方法分配的局部变量(stack内存)所分配的内存自动消失
* Heap内存中的内存需要垃圾回收机制来做回收
*
* @author MarkShen1992
* @since 20191106
*/
public class Chapter0202ValueTransferAndReferenceTransfer {
public static void main(String[] args) {
Chapter0202ValueTransferAndReferenceTransfer c = new Chapter0202ValueTransferAndReferenceTransfer();
int date = 9;
BirthDate bd = new BirthDate(1970, 7, 7 );
BirthDate bd2 = new BirthDate(2000, 1, 1);
c.change1(date);
System.out.println(date);
c.change2(bd);
System.out.println(bd);
c.change3(bd2);
System.out.println(bd2);
}
public void change1(int i) {
i = 1234;
}
public void change2(BirthDate b) {
b = new BirthDate(22, 2, 2004);
}
public void change3(BirthDate b) {
b.setDay(22);
}
}
/**
* 出生日期
*/
class BirthDate {
private int year;
private int month;
private int day;
public BirthDate() {}
public BirthDate(int year, int month, int day) {
this.year = year;
this.month = month;
this.day = day;
}
public int getYear() {
return year;
}
public void setYear(int year) {
this.year = year;
}
public int getMonth() {
return month;
}
public void setMonth(int month) {
this.month = month;
}
public int getDay() {
return day;
}
public void setDay(int day) {
this.day = day;
}
@Override
public String toString() {
return "BirthDate{" +
"year=" + year +
", month=" + month +
", day=" + day +
'}';
}
}
================================================
FILE: src/main/java/com/basic/chapter0200/Chapter0203Point.java
================================================
package com.basic.chapter0200;
/**
* 练习例子
*
* @author MarkShen1992
* @since 20191107
*/
public class Chapter0203Point {
public static void main(String[] args) {
Point p = new Point(1, 2, 3);
Point p2 = new Point(0, 0, 0);
// 函数返回值,在内存中也有一块儿空间
double result = p.getDistance(p2);
System.out.println(result);
}
}
class Point {
private double x, y, z;
public Point() {
}
public Point(double x, double y, double z) {
this.x = x;
this.y = y;
this.z = z;
}
public double getX() {
return x;
}
public void setX(double x) {
this.x = x;
}
public double getY() {
return y;
}
public void setY(double y) {
this.y = y;
}
public double getZ() {
return z;
}
public void setZ(double z) {
this.z = z;
}
public double getDistance(Point p) {
return Math.sqrt(
(this.x - p.getX()) * (this.x - p.getX()) +
(this.x - p.getX()) * (this.x - p.getX()) +
(this.z - p.getZ()) * (this.z - p.getZ())
);
}
}
================================================
FILE: src/main/java/com/basic/chapter0200/Chapter0204MethodOverload.java
================================================
package com.basic.chapter0200;
/**
* 方法重载:指一个类中可以定义有相同的名字,单参数不同的多个方法,调用时会根据参数的不同
* 调用不同的方法。
* 重载方法参数特性:
* 个数不同
* 类型不同
* 顺序不同
*
* 构造方法,普通方法皆可重载
*
* @author MarkShen1992
* @since 20191107
*/
public class Chapter0204MethodOverload {
public static int add(int a, int b) {
return a + b;
}
// 不与第一个方法产生冲突
// public static void add(int a, int b) {
// System.out.println(a + b);
// }
public static int add(short a, short b) {
return a + b;
}
public static double add(double a, int b) {
return a + b;
}
public static double add(int a, double b) {
return a + b;
}
public static double add(double... args) {
double tmpVal = 0;
for (int i=0; i<args.length; i++) {
tmpVal += args[i];
}
return tmpVal;
}
public static void main(String[] args) {
System.out.println(add(1, 2));
System.out.println(add(1, 2.0));
System.out.println(add(1.0, 2));
System.out.println(add(1.0, 1.0));
System.out.println(add(1.0, 1.0, 1.0));
short a=1;
short b=2;
System.out.println(add(a, b));
}
}
================================================
FILE: src/main/java/com/basic/chapter0200/Chapter0205TestOverLoad.java
================================================
package com.basic.chapter0200;
/**
* 练习例子
*
* @author MarkShen1992
* @since 20191107
*/
public class Chapter0205TestOverLoad {
public static void main(String[] args) {
Person p = new Person();
Person p1 = new Person(400);
Person p2 = new Person(2, 500);
p.info();
p.info("ok");
}
}
class Person {
Person() {
id = 0;
age = 20;
}
Person(int _id) {
id = _id;
age = 23;
}
Person(int _id, int _age) {
id = _id;
age = _age;
}
// 成员变量定义
private int id;
private int age = 20;
// 方法定义
public int getAge() {
return age;
}
public void setAge(int i) {
age = i;
}
public int getId() {
return id;
}
void info() {
System.out.println("my id is : " + id);
}
void info(String t) {
System.out.println(t + " id " + id);
}
}
================================================
FILE: src/main/java/com/basic/chapter0200/Chapter0206TestCircle.java
================================================
package com.basic.chapter0200;
class Point2 {
private double x;
private double y;
Point2(double x1, double y1) {
x = x1;
y = y1;
}
public double getX() {
return x;
}
public double getY() {
return y;
}
public void setX(double i) {
x = i;
}
public void setY(double i) {
y = i;
}
}
class Circle {
private Point2 o;
private double radius;
Circle(Point2 p, double r) {
o = p;
radius = r;
}
Circle(double r) {
o = new Point2(0.0, 0.0);
radius = r;
}
boolean contains(Point2 p) {
double x = p.getX() - o.getX();
double y = p.getY() - o.getY();
if (x * x + y * y > radius * radius) return false;
else return true;
}
public void setO(double x, double y) {
o.setX(x);
o.setY(y);
}
public Point2 getO() {
return o;
}
public double getRadius() {
return radius;
}
public void setRadius(double r) {
radius = r;
}
public double area() {
return 3.14 * radius * radius;
}
}
public class Chapter0206TestCircle {
public static void main(String args[]) {
Circle c1 = new Circle(new Point2(1.0, 2.0), 2.0);
Circle c2 = new Circle(5.0);
System.out.println("c1:(" + c1.getO().getX() + ","
+ c1.getO().getY() + ")," + c1.getRadius());
System.out.println("c2:(" + c2.getO().getX()
+ "," + c2.getO().getY() + ")," + c2.getRadius());
System.out.println("c1 area = " + c1.area());
System.out.println("c1 area = " + c2.area());
c1.setO(5, 6);
c2.setRadius(9.0);
System.out.println("c1:(" + c1.getO().getX() + ","
+ c1.getO().getY() + ")," + c1.getRadius());
System.out.println("c2:(" + c2.getO().getX() + ","
+ c2.getO().getY() + ")," + c2.getRadius());
System.out.println("c1 area = " + c1.area());
System.out.println("c1 area = " + c2.area());
Point2 p1 = new Point2(5.2, 6.3);
System.out.println(c1.contains(p1));
System.out.println(c1.contains(new Point2(10.0, 9.0)));
}
}
================================================
FILE: src/main/java/com/basic/chapter0200/Chapter0207this.java
================================================
package com.basic.chapter0200;
/**
* this 关键字
* 在类的方法定义中使用的this关键字代表使用该方法的对象的引用
* 当必须指定当前使用方法的对象是谁的时候用this
* 使用this处理类中构造方法中,成员变量和参数重名的问题
* 当前对象的引用
*
* @author MarkShen1992
* @since 20191113
*/
public class Chapter0207this {
int i = 0;
/**
* 原则:当你确定不了一个参数到底是哪个变量的时候,找离他最近的声明
*
*/
public Chapter0207this(int i) {
this.i = i;
}
/**
* 链式编程
* 返回值在栈空间分配
*
* @return
*/
public Chapter0207this increment() {
i ++;
return this;
}
public void print() {
System.out.println("i = " + i);
}
public static void main(String[] args) {
Chapter0207this c = new Chapter0207this(1);
c.increment().increment().print();
}
}
================================================
FILE: src/main/java/com/basic/chapter0200/Chapter0208static.java
================================================
package com.basic.chapter0200;
/**
* static 关键字
* static 修饰的成员变量为静态成员变量,它为该类的共有变量,在第一次使用时被初始化,对该类的所有
* 对象来说,static 成员变量只有一份。
* 用 static 声明的方法为静态方法,在调用该方法时,不会将对象的引用传给它,所有在静态方法中不可以
* 访问非静态成员。
* 静态方法不再是针对某个对象调用,所以不能访问非静态成员
* 可以通过类名或对象引用调用 static 方法
*
* @author MarkShen1992
* @since 20191113
*/
public class Chapter0208static {
// 存在于内存中数据区,Data Segment,可用于计数
static int i;
/**
* 静态初始化块
*/
static {
}
public static void print() {
System.out.println("hello " + i);
}
public static void main(String[] args) {
Chapter0208static.i = 10;
print();
}
}
================================================
FILE: src/main/java/com/basic/chapter0200/Chapter0209TestInherit.java
================================================
package com.basic.chapter0200;
class FatherClass {
public int value;
public void f() {
value = 100;
System.out.println("FatherClass.value=" + value);
}
}
class ChildClass extends FatherClass {
public int value;
public void f() {
super.f();
value = 200;
System.out.println("ChildClass.value=" + value);
System.out.println(value);
System.out.println(super.value);
}
}
/**
* super 关键字
*
* @author MarkShen1992
* @since 20191117
*/
public class Chapter0209TestInherit {
public static void main(String[] args) {
ChildClass cc = new ChildClass();
cc.f();
}
}
================================================
FILE: src/main/java/com/basic/chapter0200/Chapter0210TestEquals.java
================================================
package com.basic.chapter0200;
import java.util.Objects;
public class Chapter0210TestEquals {
public static void main(String[] args) {
Cat c1 = new Cat(1, 2, 3);
Cat c2 = new Cat(1, 2, 3);
System.out.println(c1 == c2);
System.out.println(c1.equals(c2));
String s1 = new String("hello");
String s2 = new String("hello");
System.out.println(s1 == s2);
System.out.println(s1.equals(s2));
}
}
class Cat {
int color;
int height, weight;
public Cat(int color, int height, int weight) {
this.color = color;
this.height = height;
this.weight = weight;
}
public boolean equals(Object obj) {
if (obj == null)
return false;
else {
if (obj instanceof Cat) {
Cat c = (Cat) obj;
if (c.color == this.color && c.height == this.height && c.weight == this.weight) {
return true;
}
}
}
return false;
}
@Override
public int hashCode() {
return Objects.hash(color, height, weight);
}
}
================================================
FILE: src/main/java/com/basic/chapter0200/Chapter0211TestFinal.java
================================================
package com.basic.chapter0200;
public class Chapter0211TestFinal {
public static void main(String[] args) {
T t = new T();
//t.i = 8;
}
}
final class T {
final int i = 8;
public final void m() {
//j = 9;
}
}
/**
* T 是被 final 修饰的类, 不可以被继承
*/
//class TT extends T {
//
//}
================================================
FILE: src/main/java/com/basic/chapter0200/Chapter0212TestInterface.java
================================================
package com.basic.chapter0200;
/**
* 接口测试
*
* @author MarkShen1992
* @since 20191120
*/
public class Chapter0212TestInterface implements A, B {
public static void main(String[] args) {
Chapter0212TestInterface t = new Chapter0212TestInterface();
t.print();
A a = new Chapter0212TestInterface();
t.print(a);
}
@Override
public void print() {
System.out.println("hello world!");
}
@Override
public void print(A a) {
System.out.println(a);
}
}
interface A {
void print();
}
interface B {
void print(A a);
}
interface C {
void test();
}
interface D extends C, A, B {
void test();
void sleep();
void sing();
}
class F implements D {
@Override
public void print() {
}
@Override
public void print(A a) {
}
@Override
public void test() {
}
@Override
public void sleep() {
}
@Override
public void sing() {
}
}
================================================
FILE: src/main/java/com/basic/chapter0200/Chapter0213DoubleBraceInitializationModel.java
================================================
package com.basic.chapter0200;
import java.util.UUID;
public class Chapter0213DoubleBraceInitializationModel {
public static void main(String[] args) {
// double brace initialization
// https://www.baeldung.com/java-double-brace-initialization
// this way can be used in making List, Set, Map, etc.
User u = new User() {
{
setUserId(UUID.randomUUID().toString());
setUserName("shenjy");
setRealName("沈军禹");
}
};
System.out.println(u);
}
}
/**
* 用户Model
*/
class User {
private String userId;
private String userName;
private String realName;
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getRealName() {
return realName;
}
public void setRealName(String realName) {
this.realName = realName;
}
@Override
public String toString() {
return "User{" + "userId='" + userId + '\'' + ", userName='" + userName + '\'' + ", realName='" + realName
+ '\'' + '}';
}
}
================================================
FILE: src/main/java/com/basic/chapter0200/MessageFormatTest.java
================================================
package com.basic.chapter0200;
import java.text.MessageFormat;
import java.util.Date;
public class MessageFormatTest {
public static void main(String[] args) {
int planet = 7;
String event = "a disturbance in the Force";
String result = MessageFormat.format("At {1,time} on {1,date}, there was {2} on planet {0,number,integer}.",
planet, new Date(), event);
System.out.println(result);
}
}
================================================
FILE: src/main/java/com/basic/chapter0200/TestSuperSub.java
================================================
package com.basic.chapter0200;
class SuperClass {
private int n;
SuperClass() {
System.out.println("SuperClass()");
}
SuperClass(int n) {
System.out.println("SuperClass(" + n + ")");
this.n = n;
}
}
class SubClass extends SuperClass {
private int n;
SubClass(int n) {
super();
System.out.println("SubClass(" + n + ")");
this.n = n;
}
SubClass() {
super(300);
System.out.println("SubClass()");
}
}
/**
* 继承中的构造方法
* 规则:
* 1. 子类在构造的时候,要首先调用父类的构造方法
* 2. super 关键字
* 3. 如果调用了 super,必须写在子类构造方法的第一行
*
* @author MarkShen1992
* @since 继承中的构造方法
*/
public class TestSuperSub {
public static void main(String arg[]) {
SubClass sc1 = new SubClass();
SubClass sc2 = new SubClass(400);
}
}
================================================
FILE: src/main/java/com/basic/chapter0300/Chapter0300ExceptionIntroduction.java
================================================
package com.basic.chapter0300;
/**
* Exception
* 异常的概念
* Java异常的分类
* 异常的捕获和处理
* 运行期出现的问题
*
* 观察错误的名字和行号特别重要
* 程序是调出来的
*
* @author MarkShen1992
* @since 20191121
*/
public class Chapter0300ExceptionIntroduction {
public static void main(String[] args) {
/**
* 对于数组越界问题,C, C++ 语言中会有问题,缓冲区溢出漏洞。
* 所以写C, C++ 程序的时候,一定要安全内容
*
* Java异常是Java提供的处理程序错误的一种机制
* 所谓错误是指在程序运行的时候发生的一些异常事件
* 设计好的程序应该在发生异常时提供异常处理的方法,使得程序不会因为异常的发生而阻断
* 或产生不可预期的后果。
* Java程序的执行过程中如果出现异常事件,可以生成一个异常对象,该异常对象封装了异常
* 事件的信息,并被提交给Java运行时系统,这个过程称为抛出异常。
* 当Java运行时系统接收到异常对象时,会寻找可以处理异常的方法,并把当前异常对象交给
* 其处理,这个过程称为捕获异常。
*
* try() {
* ...代码
* } catch (XXXException e) {
* 捕获异常后处理
* } catch (YYYException e2) {
* ...
* } finally {
* 产不产生异常,finally中的语句一定会执行
* 关闭资源
* }
*
* catch 异常的时候,要先 catch 具体的(小的)异常,然后再 catch 抽象的(大的)异常
*/
try {
System.out.println(2 / 0);
} catch (ArithmeticException e) {
System.out.println("系统正在维护中,请稍后,请与管理员联系,谢谢");
e.printStackTrace();
}
}
}
================================================
FILE: src/main/java/com/basic/chapter0300/Chapter0301TestEx.java
================================================
package com.basic.chapter0300;
import java.io.*;
/**
* 异常处理
*
* @author MarkShen
* @since 20191121
*/
public class Chapter0301TestEx {
public static void main(String[] args) {
try {
new Chapter0301TestEx().f2();
} catch (IOException e) {
e.printStackTrace();
}
/*
int[] arr = {1, 2, 3};
System.out.println(arr[2]);
try {
System.out.println(2/0);
} catch (ArithmeticException e) {
e.printStackTrace();
}
*/
//TestEx te = new TestEx();
//te.m(0);
/*
try {
new TestEx().m(0);
} catch (ArithmeticException ae) {
ae.printStackTrace();
}
*/
FileInputStream in = null;
try {
in = new FileInputStream("myfile.txt");
int b;
b = in.read();
while (b != -1) {
System.out.print((char) b);
b = in.read();
}
} catch (FileNotFoundException e) {
System.out.println(e.getMessage());
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
void m(int i) throws ArithmeticException {
if (i == 0)
throw new ArithmeticException("参数为0异常...");
}
void f() throws FileNotFoundException, IOException {
FileInputStream in = new FileInputStream("myfile.txt");
int b;
b = in.read();
while (b != -1) {
System.out.print((char) b);
b = in.read();
}
}
void f2() throws IOException {
/*
try {
f();
} catch (FileNotFoundException e) {
System.out.println(e.getMessage());
} catch (IOException e) {
e.printStackTrace();
}
*/
f();
}
}
================================================
FILE: src/main/java/com/basic/chapter0300/Chapter0302MethodException.java
================================================
package com.basic.chapter0300;
/**
* 方法异常
*
* @author MarkShen
* @since 20191121
*/
public class Chapter0302MethodException {
public static void main(String[] args) {
crunch(null);
}
static void crunch(int[] a) {
mash(a);
}
static void mash(int[] b) {
System.out.println(b[0]);
}
}
================================================
FILE: src/main/java/com/basic/chapter0300/Chapter0303Junk.java
================================================
package com.basic.chapter0300;
/**
* Method Exception handle
* 能处理的一定要处理,处理不了的往外抛
* 多读设计精巧的源码,体会设计思想尤为重要
*
* 异常和继承之间的关系
* 重写方法需要抛出与原方法所抛出异常类型一致异常或不抛出异常。
*
* @author MarkShen
* @since 20191121
*/
public class Chapter0303Junk {
public static void main(String args[]) {
try {
a();
} catch (HighLevelException e) {
e.printStackTrace();
}
}
static void a() throws HighLevelException {
try {
b();
} catch (MidLevelException e) {
throw new HighLevelException(e);
}
}
static void b() throws MidLevelException {
c();
}
static void c() throws MidLevelException {
try {
d();
} catch (LowLevelException e) {
throw new MidLevelException(e);
}
}
static void d() throws LowLevelException {
e();
}
static void e() throws LowLevelException {
throw new LowLevelException();
}
}
/**
* 使用自定义异常一般有如下步骤:
* 1. 通过继承 java.lang.Exception类声明自己的异常类
* 2. 在方法适当的位置生成自定义异常的实例,并用throw抛出
* 3. 方法级使用 throws 语句声明该方法可能抛出的异常
*/
class HighLevelException extends Exception {
HighLevelException(Throwable cause) {
super(cause);
}
}
class MidLevelException extends Exception {
MidLevelException(Throwable cause) {
super(cause);
}
}
class LowLevelException extends Exception {
}
================================================
FILE: src/main/java/com/basic/chapter0400/Chapter0401ArrayIntroduction.java
================================================
package com.basic.chapter0400;
/**
* 数组[空间]介绍
* 一维数组声明方式
* type var[] 或者 type[] var
* Java语言声明数组时不能指定其长度。
* int[5] a; // 非法,但是c或c++语言是可以的,分配在占内存空间上
* 元素为引用类型的数据中的每个元素都需要实例化
*
* 用数组模拟算法
* 算法的演进
* 数组的内存的布局
*
* @author MarkShen
* @since 20191122
*/
public class Chapter0401ArrayIntroduction {
public static void main(String[] args) {
// 第一种:静态初始化
int[] a = {1, 3, 5, 7, 9};
for (int temp : a) {
System.out.println(temp);
}
// 第二种:动态初始化
int[] arr;
arr = new int[
gitextract__3rwbfmy/
├── .editorconfig
├── .gitignore
├── .mvn/
│ ├── jvm.config
│ └── wrapper/
│ └── maven-wrapper.properties
├── .travis.yml
├── README.md
├── concurrency.md
├── jvm/
│ └── jvm8 all parameters.txt
├── mvnw
├── mvnw.cmd
├── pom.xml
├── src/
│ ├── main/
│ │ └── java/
│ │ └── com/
│ │ ├── annotation/
│ │ │ ├── README.md
│ │ │ ├── jdk/
│ │ │ │ ├── Child.java
│ │ │ │ ├── ParseAnnotation.java
│ │ │ │ ├── Person.java
│ │ │ │ └── Test.java
│ │ │ ├── own/
│ │ │ │ └── Description.java
│ │ │ └── project/
│ │ │ ├── Column.java
│ │ │ ├── Department.java
│ │ │ ├── Table.java
│ │ │ ├── Test.java
│ │ │ └── User.java
│ │ ├── art/
│ │ │ └── concurrency/
│ │ │ ├── ch01/
│ │ │ │ ├── ConcurrencyTest.java
│ │ │ │ └── DeadLockDemo.java
│ │ │ ├── ch04/
│ │ │ │ ├── Daemon.java
│ │ │ │ ├── Deprecated.java
│ │ │ │ ├── Interrupted.java
│ │ │ │ ├── MultiThread.java
│ │ │ │ ├── Priority.java
│ │ │ │ ├── Shutdown.java
│ │ │ │ └── ThreadState.java
│ │ │ ├── ch08/
│ │ │ │ ├── BankWaterService.java
│ │ │ │ ├── CountDownLatchTest.java
│ │ │ │ ├── CyclicBarrierTest.java
│ │ │ │ ├── CyclicBarrierTest02.java
│ │ │ │ ├── CyclicBarrierTest03.java
│ │ │ │ ├── ExchangerTest.java
│ │ │ │ └── SemaphoreTest.java
│ │ │ └── utils/
│ │ │ └── SleepUtils.java
│ │ ├── basic/
│ │ │ ├── alibaba/
│ │ │ │ ├── BigDecimalTest.java
│ │ │ │ ├── CollectionTest.java
│ │ │ │ ├── ConfusingName.java
│ │ │ │ ├── DateTest.java
│ │ │ │ ├── FloatPrimitiveTest.java
│ │ │ │ ├── FloatWrapTest.java
│ │ │ │ ├── IntegerCacheTest.java
│ │ │ │ ├── LockTest.java
│ │ │ │ ├── PrimitiveTypeArrayMaxSizeTest.java
│ │ │ │ ├── SwitchTest.java
│ │ │ │ └── package-info.java
│ │ │ ├── chapter0100/
│ │ │ │ ├── Chapter0100Introduction.java
│ │ │ │ ├── Chapter0101Identifier.java
│ │ │ │ ├── Chapter0102JavaKeyWord.java
│ │ │ │ ├── Chapter0103ConstantAndVariable.java
│ │ │ │ ├── Chapter0104TestVar.java
│ │ │ │ ├── Chapter0104TestVar2.java
│ │ │ │ ├── Chapter0104VariableType.java
│ │ │ │ ├── Chapter0105DataType.java
│ │ │ │ ├── Chapter0106BasicDataTypeConvertPrinciple.java
│ │ │ │ ├── Chapter0106TestConvert.java
│ │ │ │ ├── Chapter0106TestConvert2.java
│ │ │ │ ├── Chapter0107TestIF.java
│ │ │ │ ├── Chapter0108For.java
│ │ │ │ ├── Chapter0109TestWhile.java
│ │ │ │ ├── Chapter0110TestBreakAndContinue.java
│ │ │ │ ├── Chapter0111TestSwitch.java
│ │ │ │ ├── Chapter0112TestMethod.java
│ │ │ │ ├── Chapter0113TestMethod2.java
│ │ │ │ ├── Chapter0114Fab.java
│ │ │ │ ├── Test01.java
│ │ │ │ └── Test02.java
│ │ │ ├── chapter0200/
│ │ │ │ ├── Chapter0200Introduction.java
│ │ │ │ ├── Chapter0201OO.java
│ │ │ │ ├── Chapter0202ValueTransferAndReferenceTransfer.java
│ │ │ │ ├── Chapter0203Point.java
│ │ │ │ ├── Chapter0204MethodOverload.java
│ │ │ │ ├── Chapter0205TestOverLoad.java
│ │ │ │ ├── Chapter0206TestCircle.java
│ │ │ │ ├── Chapter0207this.java
│ │ │ │ ├── Chapter0208static.java
│ │ │ │ ├── Chapter0209TestInherit.java
│ │ │ │ ├── Chapter0210TestEquals.java
│ │ │ │ ├── Chapter0211TestFinal.java
│ │ │ │ ├── Chapter0212TestInterface.java
│ │ │ │ ├── Chapter0213DoubleBraceInitializationModel.java
│ │ │ │ ├── MessageFormatTest.java
│ │ │ │ └── TestSuperSub.java
│ │ │ ├── chapter0300/
│ │ │ │ ├── Chapter0300ExceptionIntroduction.java
│ │ │ │ ├── Chapter0301TestEx.java
│ │ │ │ ├── Chapter0302MethodException.java
│ │ │ │ └── Chapter0303Junk.java
│ │ │ ├── chapter0400/
│ │ │ │ ├── Chapter0401ArrayIntroduction.java
│ │ │ │ ├── Chapter0402TestArgs.java
│ │ │ │ ├── Chapter0403SortAlgorithm.java
│ │ │ │ ├── Chapter0404TestDateSort.java
│ │ │ │ ├── Chapter0405TestSearch.java
│ │ │ │ ├── Chapter0406TestArrayCopy.java
│ │ │ │ ├── Count3Quit.java
│ │ │ │ └── Count3Quit2.java
│ │ │ ├── chapter0500/
│ │ │ │ ├── Chapter0501CommonUseClass.java
│ │ │ │ ├── Chapter0502TestString2.java
│ │ │ │ ├── Chapter0503TestString3.java
│ │ │ │ ├── Chapter0504TestString.java
│ │ │ │ ├── Chapter0505StringBuffer.java
│ │ │ │ ├── Chapter0506BasicTypeWrap.java
│ │ │ │ ├── Chapter0507ArrayParser.java
│ │ │ │ ├── Chapter0508TestMath.java
│ │ │ │ ├── Chapter0509TestFile.java
│ │ │ │ ├── Chapter0510FileList.java
│ │ │ │ └── Chapter0511TestEnum.java
│ │ │ ├── chapter0600/
│ │ │ │ ├── BasicContainer.java
│ │ │ │ ├── BasicGeneric.java
│ │ │ │ ├── CollectionsTest.java
│ │ │ │ ├── DataStructureSelection.java
│ │ │ │ ├── EnhancedFor.java
│ │ │ │ ├── IteratorTest.java
│ │ │ │ ├── SetTest.java
│ │ │ │ ├── TestArgsWords.java
│ │ │ │ ├── TestArgsWords2.java
│ │ │ │ ├── TestMap.java
│ │ │ │ └── TestMap2.java
│ │ │ ├── chapter0700/
│ │ │ │ ├── FileCopy.java
│ │ │ │ ├── HelloWorld.java
│ │ │ │ ├── TestBufferStream1.java
│ │ │ │ ├── TestBufferStream2.java
│ │ │ │ ├── TestDataStream.java
│ │ │ │ ├── TestFileInputStream.java
│ │ │ │ ├── TestFileOutputStream.java
│ │ │ │ ├── TestFileReader.java
│ │ │ │ ├── TestFileWriter.java
│ │ │ │ ├── TestFileWriter2.java
│ │ │ │ ├── TestObjectIO.java
│ │ │ │ ├── TestPrintStream1.java
│ │ │ │ ├── TestPrintStream2.java
│ │ │ │ ├── TestPrintStream3.java
│ │ │ │ ├── TestTransForm1.java
│ │ │ │ ├── TestTransForm2.java
│ │ │ │ └── TreeDir.java
│ │ │ ├── chapter0800/
│ │ │ │ ├── 111.txt
│ │ │ │ ├── ProducerConsumer.java
│ │ │ │ ├── ProducerConsumer2.java
│ │ │ │ ├── RecursiveFile.java
│ │ │ │ ├── T.java
│ │ │ │ ├── TT.java
│ │ │ │ ├── Test.java
│ │ │ │ ├── TestDeadLock.java
│ │ │ │ ├── TestInterrupt.java
│ │ │ │ ├── TestJoin.java
│ │ │ │ ├── TestPriority.java
│ │ │ │ ├── TestSync.java
│ │ │ │ ├── TestThread1.java
│ │ │ │ ├── TestThread2.java
│ │ │ │ ├── TestThread3.java
│ │ │ │ ├── TestThread4.java
│ │ │ │ ├── TestThread5.java
│ │ │ │ ├── TestThread6.java
│ │ │ │ └── TestYield.java
│ │ │ ├── chapter0900/
│ │ │ │ ├── Chapter0901TestUDPClient.java
│ │ │ │ ├── Chapter0901TestUDPServer.java
│ │ │ │ ├── Chat/
│ │ │ │ │ ├── Chat03/
│ │ │ │ │ │ ├── ChatClient.java
│ │ │ │ │ │ └── ChatServer.java
│ │ │ │ │ ├── Chat05/
│ │ │ │ │ │ ├── ChatClient.java
│ │ │ │ │ │ └── ChatServer.java
│ │ │ │ │ ├── Chat07/
│ │ │ │ │ │ ├── ChatClient.java
│ │ │ │ │ │ └── ChatServer.java
│ │ │ │ │ └── Chat10/
│ │ │ │ │ ├── ChatClient.java
│ │ │ │ │ └── ChatServer.java
│ │ │ │ ├── TCPClient.java
│ │ │ │ ├── TCPServer.java
│ │ │ │ ├── TalkClient.java
│ │ │ │ ├── TalkServer.java
│ │ │ │ ├── TestClient.java
│ │ │ │ ├── TestServer.java
│ │ │ │ ├── TestSockClient.java
│ │ │ │ ├── TestSockServer.java
│ │ │ │ ├── TestUDPClient.java
│ │ │ │ ├── TestUDPServer.java
│ │ │ │ └── zerocopy/
│ │ │ │ ├── traditonal/
│ │ │ │ │ ├── TraditionalClient.java
│ │ │ │ │ └── TraditionalServer.java
│ │ │ │ └── transfer/
│ │ │ │ ├── TransferToClient.java
│ │ │ │ └── TransferToServer.java
│ │ │ ├── chapter1000/
│ │ │ │ ├── AWTDrawing.java
│ │ │ │ ├── AWTDrawing2.java
│ │ │ │ ├── CenterPanel.java
│ │ │ │ ├── MyMouseAdapter.java
│ │ │ │ ├── MyMouseAdapterGeneric.java
│ │ │ │ ├── NestedContainer.java
│ │ │ │ ├── TFActionEvent.java
│ │ │ │ ├── TFMath.java
│ │ │ │ ├── TFMathTest.java
│ │ │ │ ├── TFMathTest2.java
│ │ │ │ ├── TFPassword.java
│ │ │ │ ├── TenButtons.java
│ │ │ │ ├── Test.java
│ │ │ │ ├── TestActionEvent.java
│ │ │ │ ├── TestActionEvent2.java
│ │ │ │ ├── TestAnonymous.java
│ │ │ │ ├── TestAnonymous2.java
│ │ │ │ ├── TestBorderLayout.java
│ │ │ │ ├── TestFlowLayout.java
│ │ │ │ ├── TestFlowLayout2.java
│ │ │ │ ├── TestFrame.java
│ │ │ │ ├── TestFrameWithPanel.java
│ │ │ │ ├── TestGridLayout.java
│ │ │ │ ├── TestInner.java
│ │ │ │ ├── TestKey.java
│ │ │ │ ├── TestMouseMotion.java
│ │ │ │ ├── TestMouseMotionGeneric.java
│ │ │ │ ├── TestMultiFrame.java
│ │ │ │ ├── TestMultiPanel.java
│ │ │ │ ├── TestPaint.java
│ │ │ │ ├── TestPanel.java
│ │ │ │ └── TestWindowClose.java
│ │ │ ├── chapter1100/
│ │ │ │ └── TestReflect.java
│ │ │ └── chapter1200/
│ │ │ ├── QQClient.java
│ │ │ └── QQServer.java
│ │ ├── geo/
│ │ │ ├── GeoLite2-City.mmdb
│ │ │ └── GeoTest.java
│ │ ├── java10/
│ │ │ └── NewFeatures.java
│ │ ├── java11/
│ │ │ └── NewFeatures.java
│ │ ├── java12/
│ │ │ └── NewFeatures.java
│ │ ├── java13/
│ │ │ └── NewFeatures.java
│ │ ├── java14/
│ │ │ └── Java14NewFeatures.java
│ │ ├── java15/
│ │ │ └── NewFeatures.java
│ │ ├── java16/
│ │ │ └── Java16NewFeatures.java
│ │ ├── java17/
│ │ │ └── Java17NewFeatures.java
│ │ ├── java18/
│ │ │ └── Java18Features.java
│ │ ├── java19/
│ │ │ └── Java19Features.java
│ │ ├── java5/
│ │ │ └── NewFeatures.java
│ │ ├── java6/
│ │ │ └── NewFeatures.java
│ │ ├── java7/
│ │ │ └── NewFeatures.java
│ │ ├── java8/
│ │ │ ├── Demo0100_LambdaRunnable.java
│ │ │ ├── Demo0200_LambdaIterator.java
│ │ │ ├── Demo0300_LambdaPredicate.java
│ │ │ ├── Demo0400_LambdaMapReduce.java
│ │ │ ├── Demo0500_LambdaSimpleDemo.java
│ │ │ ├── Demo0600_Stream.java
│ │ │ ├── Demo0700_Stream.java
│ │ │ ├── Demo0800_Stream.java
│ │ │ ├── NewFeatures.java
│ │ │ └── Person.java
│ │ ├── java9/
│ │ │ └── NewFeatures.java
│ │ ├── jvm/
│ │ │ └── OutOfMemoryException.java
│ │ ├── mark/
│ │ │ ├── concurrent01/
│ │ │ │ └── T.java
│ │ │ ├── concurrent02/
│ │ │ │ ├── T.java
│ │ │ │ └── T2.java
│ │ │ ├── concurrent03/
│ │ │ │ └── T.java
│ │ │ ├── concurrent04/
│ │ │ │ └── T.java
│ │ │ ├── concurrent05/
│ │ │ │ └── T.java
│ │ │ ├── concurrent06/
│ │ │ │ ├── T.java
│ │ │ │ └── T2.java
│ │ │ ├── concurrent07/
│ │ │ │ └── T.java
│ │ │ ├── concurrent08/
│ │ │ │ └── Account.java
│ │ │ ├── concurrent09/
│ │ │ │ └── T.java
│ │ │ ├── concurrent10/
│ │ │ │ └── T.java
│ │ │ ├── concurrent11/
│ │ │ │ └── T.java
│ │ │ ├── concurrent12/
│ │ │ │ └── T.java
│ │ │ ├── concurrent13/
│ │ │ │ └── T.java
│ │ │ ├── concurrent14/
│ │ │ │ └── T.java
│ │ │ ├── concurrent15/
│ │ │ │ └── T.java
│ │ │ ├── concurrent16/
│ │ │ │ └── T.java
│ │ │ ├── concurrent17/
│ │ │ │ └── T.java
│ │ │ ├── concurrent18/
│ │ │ │ └── T.java
│ │ │ ├── concurrent19/
│ │ │ │ ├── MyContainer1.java
│ │ │ │ ├── MyContainer2.java
│ │ │ │ ├── MyContainer3.java
│ │ │ │ ├── MyContainer4.java
│ │ │ │ └── MyContainer5.java
│ │ │ ├── concurrent20/
│ │ │ │ ├── ReentrantLock1.java
│ │ │ │ ├── ReentrantLock2.java
│ │ │ │ ├── ReentrantLock3.java
│ │ │ │ ├── ReentrantLock4.java
│ │ │ │ └── ReentrantLock5.java
│ │ │ ├── concurrent21/
│ │ │ │ ├── MyContainer1.java
│ │ │ │ └── MyContainer2.java
│ │ │ ├── concurrent22/
│ │ │ │ ├── ThreadLocal1.java
│ │ │ │ └── ThreadLocal2.java
│ │ │ ├── concurrent23/
│ │ │ │ └── Singleton.java
│ │ │ ├── concurrent24/
│ │ │ │ ├── TicketSeller1.java
│ │ │ │ ├── TicketSeller2.java
│ │ │ │ ├── TicketSeller3.java
│ │ │ │ └── TicketSeller4.java
│ │ │ ├── concurrent25/
│ │ │ │ ├── T01_ConcurrentMap.java
│ │ │ │ ├── T02_CopyOnWriteList.java
│ │ │ │ ├── T03_SynchronizedList.java
│ │ │ │ ├── T04_ConcurrentQueue.java
│ │ │ │ ├── T05_LinkedBlockingQueue.java
│ │ │ │ ├── T06_ArrayBlockingQueue.java
│ │ │ │ ├── T07_DelayQueue.java
│ │ │ │ ├── T08_TransferQueue.java
│ │ │ │ └── T09_SynchronousQueue.java
│ │ │ ├── concurrent26/
│ │ │ │ ├── T01_MyExecutor.java
│ │ │ │ ├── T02_ExecutorService.java
│ │ │ │ ├── T03_Callable.java
│ │ │ │ ├── T04_Executors.java
│ │ │ │ ├── T05_ThreadPool.java
│ │ │ │ ├── T06_Future.java
│ │ │ │ ├── T07_ParallelComputing.java
│ │ │ │ ├── T08_CachedThreadPool.java
│ │ │ │ ├── T09_SingleThreadPool.java
│ │ │ │ ├── T10_ScheduleThreadPool.java
│ │ │ │ ├── T11_WorkStealingPool.java
│ │ │ │ ├── T12_ForkJoinPool.java
│ │ │ │ ├── T13_ThreadPoolExecutor.java
│ │ │ │ ├── T14_ParallelStreamAPI.java
│ │ │ │ ├── T15_SelfDefinitionThreadPool.java
│ │ │ │ └── readme.txt
│ │ │ └── note/
│ │ │ └── question.md
│ │ ├── mmap/
│ │ │ ├── MemoryBufferTest.java
│ │ │ └── MmapWriteReadTest.java
│ │ ├── program/
│ │ │ ├── CodeGenerator.java
│ │ │ ├── CollectionIterate.java
│ │ │ ├── ConstructTree.java
│ │ │ ├── FizzBuzzDemo.java
│ │ │ ├── ULIDTest.java
│ │ │ └── WechatCircleLikeDisplay.java
│ │ ├── snake/
│ │ │ ├── Direction.java
│ │ │ ├── Egg.java
│ │ │ ├── Node.java
│ │ │ ├── Snake.java
│ │ │ └── Yard.java
│ │ └── thread/
│ │ ├── AnimalBehavior.java
│ │ ├── Cat.java
│ │ ├── CatMain.java
│ │ ├── MyRunnable.java
│ │ ├── MyRunnableTest.java
│ │ ├── NotifySpecifiedThread.java
│ │ ├── T.java
│ │ └── T01_TestJoin.java
│ └── test/
│ └── java/
│ └── com/
│ ├── java8/
│ │ └── NewFeatureTest.java
│ └── mark/
│ └── concurrent01/
│ └── TTest.java
├── style/
│ ├── STYLE.md
│ └── codestyle/
│ ├── eclipse/
│ │ └── codestyle.xml
│ └── idea/
│ └── codestyle.xml
└── test/
└── test.txt
SYMBOL INDEX (1172 symbols across 311 files)
FILE: src/main/java/com/annotation/jdk/Child.java
class Child (line 14) | @Description("I am a class annotation.")
method name (line 17) | @Override
method age (line 23) | @Override
method sing (line 28) | @Override
FILE: src/main/java/com/annotation/jdk/ParseAnnotation.java
class ParseAnnotation (line 8) | public class ParseAnnotation {
method main (line 9) | public static void main(String[] args) {
FILE: src/main/java/com/annotation/jdk/Person.java
type Person (line 10) | public interface Person {
method name (line 12) | public String name();
method age (line 14) | public int age();
method sing (line 16) | @Deprecated
FILE: src/main/java/com/annotation/jdk/Test.java
class Test (line 15) | public class Test {
method sing (line 16) | @SuppressWarnings("deprecation")
FILE: src/main/java/com/annotation/project/Department.java
class Department (line 3) | @Table("t_department")
method getId (line 14) | public int getId() {
method setId (line 18) | public void setId(int id) {
method getName (line 22) | public String getName() {
method setName (line 26) | public void setName(String name) {
method getLeader (line 30) | public String getLeader() {
method setLeader (line 34) | public void setLeader(String leader) {
method getAmount (line 38) | public int getAmount() {
method setAmout (line 42) | public void setAmout(int amount) {
FILE: src/main/java/com/annotation/project/Test.java
class Test (line 6) | public class Test {
method main (line 7) | public static void main(String[] args) {
method query (line 32) | private static String query(Object u) {
FILE: src/main/java/com/annotation/project/User.java
class User (line 3) | @Table("t_user")
method getId (line 21) | public int getId() {
method setId (line 25) | public void setId(int id) {
method getUserName (line 29) | public String getUserName() {
method setUserName (line 33) | public void setUserName(String userName) {
method getNickName (line 37) | public String getNickName() {
method setNickName (line 41) | public void setNickName(String nickName) {
method getAge (line 45) | public int getAge() {
method setAge (line 49) | public void setAge(int age) {
method getCity (line 53) | public String getCity() {
method setCity (line 57) | public void setCity(String city) {
method getEmail (line 61) | public String getEmail() {
method setEmail (line 65) | public void setEmail(String email) {
method getMobile (line 69) | public String getMobile() {
method setMobile (line 73) | public void setMobile(String mobile) {
FILE: src/main/java/com/art/concurrency/ch01/ConcurrencyTest.java
class ConcurrencyTest (line 12) | public class ConcurrencyTest {
method main (line 15) | public static void main(String[] args) throws InterruptedException {
method serial (line 20) | private static void serial() {
method concurrency (line 34) | private static void concurrency() throws InterruptedException {
FILE: src/main/java/com/art/concurrency/ch01/DeadLockDemo.java
class DeadLockDemo (line 3) | public class DeadLockDemo {
method main (line 7) | public static void main(String[] args) {
method deadLock (line 11) | private void deadLock() {
FILE: src/main/java/com/art/concurrency/ch04/Daemon.java
class Daemon (line 5) | public class Daemon {
method main (line 6) | public static void main(String[] args) {
class DaemonRunner (line 12) | static class DaemonRunner implements Runnable {
method run (line 14) | @Override
FILE: src/main/java/com/art/concurrency/ch04/Deprecated.java
class Deprecated (line 10) | public class Deprecated {
method main (line 11) | public static void main(String[] args) throws InterruptedException {
class Runner (line 31) | static class Runner implements Runnable {
method run (line 32) | @Override
FILE: src/main/java/com/art/concurrency/ch04/Interrupted.java
class Interrupted (line 7) | public class Interrupted {
method main (line 8) | public static void main(String[] args) throws InterruptedException {
class SleepRunner (line 28) | static class SleepRunner implements Runnable {
method run (line 29) | @Override
class BusyRunner (line 37) | static class BusyRunner implements Runnable {
method run (line 38) | @Override
FILE: src/main/java/com/art/concurrency/ch04/MultiThread.java
class MultiThread (line 7) | public class MultiThread {
method main (line 8) | public static void main(String[] args) {
FILE: src/main/java/com/art/concurrency/ch04/Priority.java
class Priority (line 7) | public class Priority {
method main (line 11) | public static void main(String[] args) throws InterruptedException {
class Job (line 30) | static class Job implements Runnable {
method Job (line 34) | public Job() {
method Job (line 37) | public Job(int priority) {
method Job (line 41) | public Job(int priority, long jobCount) {
method run (line 46) | @Override
FILE: src/main/java/com/art/concurrency/ch04/Shutdown.java
class Shutdown (line 5) | public class Shutdown {
method main (line 6) | public static void main(String[] args) throws InterruptedException {
class Runner (line 21) | static class Runner implements Runnable {
method run (line 25) | @Override
method cancel (line 33) | public void cancel() {
FILE: src/main/java/com/art/concurrency/ch04/ThreadState.java
class ThreadState (line 8) | public class ThreadState {
method main (line 9) | public static void main(String[] args) {
class TimeWaiting (line 20) | static class TimeWaiting implements Runnable {
method run (line 22) | @Override
class Waiting (line 28) | static class Waiting implements Runnable {
method run (line 30) | @Override
class Blocked (line 44) | static class Blocked implements Runnable {
method run (line 46) | @Override
FILE: src/main/java/com/art/concurrency/ch08/BankWaterService.java
class BankWaterService (line 6) | public class BankWaterService implements Runnable {
method count (line 23) | private void count() {
method run (line 43) | @Override
method main (line 55) | public static void main(String[] args) {
FILE: src/main/java/com/art/concurrency/ch08/CountDownLatchTest.java
class CountDownLatchTest (line 5) | public class CountDownLatchTest {
method main (line 9) | public static void main(String[] args) throws InterruptedException {
FILE: src/main/java/com/art/concurrency/ch08/CyclicBarrierTest.java
class CyclicBarrierTest (line 9) | public class CyclicBarrierTest {
method main (line 12) | public static void main(String[] args) throws BrokenBarrierException, ...
FILE: src/main/java/com/art/concurrency/ch08/CyclicBarrierTest02.java
class CyclicBarrierTest02 (line 6) | public class CyclicBarrierTest02 {
method main (line 9) | public static void main(String[] args) throws BrokenBarrierException, ...
class A (line 28) | static class A implements Runnable {
method run (line 30) | @Override
FILE: src/main/java/com/art/concurrency/ch08/CyclicBarrierTest03.java
class CyclicBarrierTest03 (line 6) | public class CyclicBarrierTest03 {
method main (line 9) | public static void main(String[] args) {
FILE: src/main/java/com/art/concurrency/ch08/ExchangerTest.java
class ExchangerTest (line 11) | public class ExchangerTest {
method main (line 15) | public static void main(String[] args) {
FILE: src/main/java/com/art/concurrency/ch08/SemaphoreTest.java
class SemaphoreTest (line 13) | public class SemaphoreTest {
method main (line 23) | public static void main(String[] args) {
FILE: src/main/java/com/art/concurrency/utils/SleepUtils.java
class SleepUtils (line 5) | public class SleepUtils {
method second (line 6) | public static final void second(long seconds) {
FILE: src/main/java/com/basic/alibaba/BigDecimalTest.java
class BigDecimalTest (line 10) | public class BigDecimalTest {
method main (line 11) | public static void main(String[] args) {
FILE: src/main/java/com/basic/alibaba/CollectionTest.java
class CollectionTest (line 9) | public class CollectionTest {
FILE: src/main/java/com/basic/alibaba/ConfusingName.java
class ConfusingName (line 7) | public class ConfusingName {
method get (line 12) | public void get(String alibaba) {
class Son (line 23) | class Son extends ConfusingName {
FILE: src/main/java/com/basic/alibaba/DateTest.java
class DateTest (line 14) | public class DateTest {
method main (line 28) | public static void main(String[] args) {
method getDaysOfCurrentYear (line 51) | private static int getDaysOfCurrentYear(int currentYear) {
FILE: src/main/java/com/basic/alibaba/FloatPrimitiveTest.java
class FloatPrimitiveTest (line 8) | public class FloatPrimitiveTest {
method main (line 9) | public static void main(String[] args) {
FILE: src/main/java/com/basic/alibaba/FloatWrapTest.java
class FloatWrapTest (line 8) | public class FloatWrapTest {
method main (line 9) | public static void main(String[] args) {
FILE: src/main/java/com/basic/alibaba/IntegerCacheTest.java
class IntegerCacheTest (line 9) | public class IntegerCacheTest {
method main (line 10) | public static void main(String[] args) {
FILE: src/main/java/com/basic/alibaba/LockTest.java
class LockTest (line 11) | public class LockTest {
method main (line 14) | public static void main(String[] args) {
FILE: src/main/java/com/basic/alibaba/PrimitiveTypeArrayMaxSizeTest.java
class PrimitiveTypeArrayMaxSizeTest (line 7) | public class PrimitiveTypeArrayMaxSizeTest {
method main (line 8) | public static void main(String[] args) {
FILE: src/main/java/com/basic/alibaba/SwitchTest.java
class SwitchTest (line 8) | public class SwitchTest {
method main (line 9) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0100/Chapter0100Introduction.java
class Chapter0100Introduction (line 10) | public class Chapter0100Introduction {
method main (line 11) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0100/Chapter0101Identifier.java
class Chapter0101Identifier (line 8) | public class Chapter0101Identifier {
method main (line 9) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0100/Chapter0102JavaKeyWord.java
class Chapter0102JavaKeyWord (line 8) | public class Chapter0102JavaKeyWord {
method main (line 9) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0100/Chapter0103ConstantAndVariable.java
class Chapter0103ConstantAndVariable (line 8) | public class Chapter0103ConstantAndVariable {
method main (line 9) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0100/Chapter0104TestVar.java
class Chapter0104TestVar (line 9) | public class Chapter0104TestVar {
method m (line 13) | public void m() {
method main (line 18) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0100/Chapter0104TestVar2.java
class Chapter0104TestVar2 (line 8) | public class Chapter0104TestVar2 {
method main (line 9) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0100/Chapter0104VariableType.java
class Chapter0104VariableType (line 8) | public class Chapter0104VariableType {
method main (line 13) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0100/Chapter0105DataType.java
class Chapter0105DataType (line 8) | public class Chapter0105DataType {
method main (line 9) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0100/Chapter0106BasicDataTypeConvertPrinciple.java
class Chapter0106BasicDataTypeConvertPrinciple (line 8) | public class Chapter0106BasicDataTypeConvertPrinciple {
method main (line 9) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0100/Chapter0106TestConvert.java
class Chapter0106TestConvert (line 8) | public class Chapter0106TestConvert {
method main (line 9) | public static void main(String arg[]) {
FILE: src/main/java/com/basic/chapter0100/Chapter0106TestConvert2.java
class Chapter0106TestConvert2 (line 3) | public class Chapter0106TestConvert2 {
method main (line 4) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0100/Chapter0107TestIF.java
class Chapter0107TestIF (line 8) | public class Chapter0107TestIF {
method main (line 9) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0100/Chapter0108For.java
class Chapter0108For (line 12) | public class Chapter0108For {
method main (line 13) | public static void main(String[] args) {
method foreachTest (line 27) | public static void foreachTest() {
method factorialCompute (line 40) | public static int factorialCompute(int factorial) {
method factorialRecursion (line 63) | public static int factorialRecursion(int factorial) {
FILE: src/main/java/com/basic/chapter0100/Chapter0109TestWhile.java
class Chapter0109TestWhile (line 10) | public class Chapter0109TestWhile {
method main (line 11) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0100/Chapter0110TestBreakAndContinue.java
class Chapter0110TestBreakAndContinue (line 10) | public class Chapter0110TestBreakAndContinue {
method main (line 11) | public static void main(String[] args) {
method continueTest (line 16) | private static void continueTest() {
method breakTest (line 23) | private static void breakTest() {
FILE: src/main/java/com/basic/chapter0100/Chapter0111TestSwitch.java
class Chapter0111TestSwitch (line 8) | public class Chapter0111TestSwitch {
method main (line 9) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0100/Chapter0112TestMethod.java
class Chapter0112TestMethod (line 9) | public class Chapter0112TestMethod {
method main (line 10) | public static void main(String[] args) {
method m (line 19) | public static void m() {
method m2 (line 25) | public static void m2(int i) {
method m3 (line 31) | public static void m3(int i, int j) {
method m4 (line 35) | public static int m4(int i, int j) {
FILE: src/main/java/com/basic/chapter0100/Chapter0113TestMethod2.java
class Chapter0113TestMethod2 (line 8) | public class Chapter0113TestMethod2 {
method max (line 10) | public int max(int a, int b) {
method min (line 14) | public int min(int a, int b) {
method main (line 18) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0100/Chapter0114Fab.java
class Chapter0114Fab (line 3) | public class Chapter0114Fab {
method main (line 4) | public static void main(String[] args) {
method f (line 8) | public static long f(int index) {
FILE: src/main/java/com/basic/chapter0100/Test01.java
class Test01 (line 9) | public class Test01 {
method main (line 10) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0100/Test02.java
class Test02 (line 9) | public class Test02 {
method main (line 10) | public static void main(String[] args) {
method f (line 40) | public static int f(int n) {
FILE: src/main/java/com/basic/chapter0200/Chapter0200Introduction.java
class Chapter0200Introduction (line 21) | public class Chapter0200Introduction {
method main (line 22) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0200/Chapter0201OO.java
class Chapter0201OO (line 8) | public class Chapter0201OO {
method main (line 9) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0200/Chapter0202ValueTransferAndReferenceTransfer.java
class Chapter0202ValueTransferAndReferenceTransfer (line 12) | public class Chapter0202ValueTransferAndReferenceTransfer {
method main (line 13) | public static void main(String[] args) {
method change1 (line 26) | public void change1(int i) {
method change2 (line 30) | public void change2(BirthDate b) {
method change3 (line 34) | public void change3(BirthDate b) {
class BirthDate (line 42) | class BirthDate {
method BirthDate (line 47) | public BirthDate() {}
method BirthDate (line 49) | public BirthDate(int year, int month, int day) {
method getYear (line 55) | public int getYear() {
method setYear (line 59) | public void setYear(int year) {
method getMonth (line 63) | public int getMonth() {
method setMonth (line 67) | public void setMonth(int month) {
method getDay (line 71) | public int getDay() {
method setDay (line 75) | public void setDay(int day) {
method toString (line 79) | @Override
FILE: src/main/java/com/basic/chapter0200/Chapter0203Point.java
class Chapter0203Point (line 9) | public class Chapter0203Point {
method main (line 10) | public static void main(String[] args) {
class Point (line 19) | class Point {
method Point (line 22) | public Point() {
method Point (line 25) | public Point(double x, double y, double z) {
method getX (line 31) | public double getX() {
method setX (line 35) | public void setX(double x) {
method getY (line 39) | public double getY() {
method setY (line 43) | public void setY(double y) {
method getZ (line 47) | public double getZ() {
method setZ (line 51) | public void setZ(double z) {
method getDistance (line 55) | public double getDistance(Point p) {
FILE: src/main/java/com/basic/chapter0200/Chapter0204MethodOverload.java
class Chapter0204MethodOverload (line 16) | public class Chapter0204MethodOverload {
method add (line 18) | public static int add(int a, int b) {
method add (line 27) | public static int add(short a, short b) {
method add (line 31) | public static double add(double a, int b) {
method add (line 35) | public static double add(int a, double b) {
method add (line 39) | public static double add(double... args) {
method main (line 47) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0200/Chapter0205TestOverLoad.java
class Chapter0205TestOverLoad (line 9) | public class Chapter0205TestOverLoad {
method main (line 10) | public static void main(String[] args) {
class Person (line 19) | class Person {
method Person (line 21) | Person() {
method Person (line 26) | Person(int _id) {
method Person (line 31) | Person(int _id, int _age) {
method getAge (line 41) | public int getAge() {
method setAge (line 45) | public void setAge(int i) {
method getId (line 49) | public int getId() {
method info (line 53) | void info() {
method info (line 57) | void info(String t) {
FILE: src/main/java/com/basic/chapter0200/Chapter0206TestCircle.java
class Point2 (line 3) | class Point2 {
method Point2 (line 7) | Point2(double x1, double y1) {
method getX (line 12) | public double getX() {
method getY (line 16) | public double getY() {
method setX (line 20) | public void setX(double i) {
method setY (line 24) | public void setY(double i) {
class Circle (line 29) | class Circle {
method Circle (line 33) | Circle(Point2 p, double r) {
method Circle (line 38) | Circle(double r) {
method contains (line 43) | boolean contains(Point2 p) {
method setO (line 51) | public void setO(double x, double y) {
method getO (line 56) | public Point2 getO() {
method getRadius (line 60) | public double getRadius() {
method setRadius (line 64) | public void setRadius(double r) {
method area (line 68) | public double area() {
class Chapter0206TestCircle (line 73) | public class Chapter0206TestCircle {
method main (line 74) | public static void main(String args[]) {
FILE: src/main/java/com/basic/chapter0200/Chapter0207this.java
class Chapter0207this (line 13) | public class Chapter0207this {
method Chapter0207this (line 21) | public Chapter0207this(int i) {
method increment (line 31) | public Chapter0207this increment() {
method print (line 36) | public void print() {
method main (line 40) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0200/Chapter0208static.java
class Chapter0208static (line 15) | public class Chapter0208static {
method print (line 27) | public static void print() {
method main (line 31) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0200/Chapter0209TestInherit.java
class FatherClass (line 3) | class FatherClass {
method f (line 6) | public void f() {
class ChildClass (line 12) | class ChildClass extends FatherClass {
method f (line 15) | public void f() {
class Chapter0209TestInherit (line 30) | public class Chapter0209TestInherit {
method main (line 31) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0200/Chapter0210TestEquals.java
class Chapter0210TestEquals (line 5) | public class Chapter0210TestEquals {
method main (line 6) | public static void main(String[] args) {
class Cat (line 19) | class Cat {
method Cat (line 23) | public Cat(int color, int height, int weight) {
method equals (line 29) | public boolean equals(Object obj) {
method hashCode (line 43) | @Override
FILE: src/main/java/com/basic/chapter0200/Chapter0211TestFinal.java
class Chapter0211TestFinal (line 3) | public class Chapter0211TestFinal {
method main (line 4) | public static void main(String[] args) {
class T (line 10) | final class T {
method m (line 12) | public final void m() {
FILE: src/main/java/com/basic/chapter0200/Chapter0212TestInterface.java
class Chapter0212TestInterface (line 9) | public class Chapter0212TestInterface implements A, B {
method main (line 10) | public static void main(String[] args) {
method print (line 18) | @Override
method print (line 23) | @Override
type A (line 29) | interface A {
method print (line 30) | void print();
type B (line 33) | interface B {
method print (line 34) | void print(A a);
type C (line 37) | interface C {
method test (line 38) | void test();
type D (line 41) | interface D extends C, A, B {
method test (line 42) | void test();
method sleep (line 43) | void sleep();
method sing (line 44) | void sing();
class F (line 47) | class F implements D {
method print (line 49) | @Override
method print (line 54) | @Override
method test (line 59) | @Override
method sleep (line 64) | @Override
method sing (line 69) | @Override
FILE: src/main/java/com/basic/chapter0200/Chapter0213DoubleBraceInitializationModel.java
class Chapter0213DoubleBraceInitializationModel (line 5) | public class Chapter0213DoubleBraceInitializationModel {
method main (line 6) | public static void main(String[] args) {
class User (line 24) | class User {
method getUserId (line 32) | public String getUserId() {
method setUserId (line 36) | public void setUserId(String userId) {
method getUserName (line 40) | public String getUserName() {
method setUserName (line 44) | public void setUserName(String userName) {
method getRealName (line 48) | public String getRealName() {
method setRealName (line 52) | public void setRealName(String realName) {
method toString (line 56) | @Override
FILE: src/main/java/com/basic/chapter0200/MessageFormatTest.java
class MessageFormatTest (line 6) | public class MessageFormatTest {
method main (line 7) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0200/TestSuperSub.java
class SuperClass (line 3) | class SuperClass {
method SuperClass (line 6) | SuperClass() {
method SuperClass (line 10) | SuperClass(int n) {
class SubClass (line 16) | class SubClass extends SuperClass {
method SubClass (line 19) | SubClass(int n) {
method SubClass (line 25) | SubClass() {
class TestSuperSub (line 41) | public class TestSuperSub {
method main (line 42) | public static void main(String arg[]) {
FILE: src/main/java/com/basic/chapter0300/Chapter0300ExceptionIntroduction.java
class Chapter0300ExceptionIntroduction (line 16) | public class Chapter0300ExceptionIntroduction {
method main (line 17) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0300/Chapter0301TestEx.java
class Chapter0301TestEx (line 11) | public class Chapter0301TestEx {
method main (line 12) | public static void main(String[] args) {
method m (line 62) | void m(int i) throws ArithmeticException {
method f (line 67) | void f() throws FileNotFoundException, IOException {
method f2 (line 77) | void f2() throws IOException {
FILE: src/main/java/com/basic/chapter0300/Chapter0302MethodException.java
class Chapter0302MethodException (line 9) | public class Chapter0302MethodException {
method main (line 10) | public static void main(String[] args) {
method crunch (line 14) | static void crunch(int[] a) {
method mash (line 17) | static void mash(int[] b) {
FILE: src/main/java/com/basic/chapter0300/Chapter0303Junk.java
class Chapter0303Junk (line 14) | public class Chapter0303Junk {
method main (line 15) | public static void main(String args[]) {
method a (line 23) | static void a() throws HighLevelException {
method b (line 31) | static void b() throws MidLevelException {
method c (line 35) | static void c() throws MidLevelException {
method d (line 43) | static void d() throws LowLevelException {
method e (line 47) | static void e() throws LowLevelException {
class HighLevelException (line 58) | class HighLevelException extends Exception {
method HighLevelException (line 59) | HighLevelException(Throwable cause) {
class MidLevelException (line 64) | class MidLevelException extends Exception {
method MidLevelException (line 65) | MidLevelException(Throwable cause) {
class LowLevelException (line 70) | class LowLevelException extends Exception {
FILE: src/main/java/com/basic/chapter0400/Chapter0401ArrayIntroduction.java
class Chapter0401ArrayIntroduction (line 18) | public class Chapter0401ArrayIntroduction {
method main (line 19) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0400/Chapter0402TestArgs.java
class Chapter0402TestArgs (line 3) | public class Chapter0402TestArgs {
method main (line 4) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0400/Chapter0403SortAlgorithm.java
class Chapter0403SortAlgorithm (line 16) | public class Chapter0403SortAlgorithm {
method main (line 25) | public static void main(String[] args) {
method selectionSort (line 44) | private static int[] selectionSort(int[] arr) {
method selectionSort (line 67) | private static double[] selectionSort(double[] arr) {
FILE: src/main/java/com/basic/chapter0400/Chapter0404TestDateSort.java
class Chapter0404TestDateSort (line 9) | public class Chapter0404TestDateSort {
method main (line 10) | public static void main(String[] args) {
method bubbleSort (line 30) | public static Date[] bubbleSort(Date[] a) {
method binarySearch (line 44) | public static int binarySearch(Date[] days, Date d) {
class Date (line 64) | class Date {
method Date (line 67) | Date(int y, int m, int d) {
method compare (line 73) | public int compare(Date date) {
method toString (line 82) | public String toString() {
FILE: src/main/java/com/basic/chapter0400/Chapter0405TestSearch.java
class Chapter0405TestSearch (line 10) | public class Chapter0405TestSearch {
method main (line 11) | public static void main(String[] args) {
method search (line 18) | public static int search(int[] a, int num) {
method binarySearch (line 25) | public static int binarySearch(int[] a, int num) {
FILE: src/main/java/com/basic/chapter0400/Chapter0406TestArrayCopy.java
class Chapter0406TestArrayCopy (line 3) | public class Chapter0406TestArrayCopy {
method main (line 4) | public static void main(String args[]) {
FILE: src/main/java/com/basic/chapter0400/Count3Quit.java
class Count3Quit (line 9) | public class Count3Quit {
method main (line 10) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0400/Count3Quit2.java
class Count3Quit2 (line 9) | public class Count3Quit2 {
method main (line 10) | public static void main(String[] args) {
class Kid (line 27) | class Kid {
class KidCircle (line 33) | class KidCircle {
method KidCircle (line 37) | KidCircle(int n) {
method add (line 43) | void add() {
method delete (line 61) | void delete(Kid k) {
FILE: src/main/java/com/basic/chapter0500/Chapter0501CommonUseClass.java
class Chapter0501CommonUseClass (line 11) | public class Chapter0501CommonUseClass {
method main (line 12) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0500/Chapter0502TestString2.java
class Chapter0502TestString2 (line 9) | public class Chapter0502TestString2 {
method main (line 10) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0500/Chapter0503TestString3.java
class Chapter0503TestString3 (line 11) | public class Chapter0503TestString3 {
method main (line 12) | public static void main(String[] args) {
method countA2Z (line 58) | private static int countA2Z(String string) {
method countLowerCase (line 69) | private static int countLowerCase(String string) {
method countLowerCase2 (line 80) | private static int countLowerCase2(String string) {
method counta2z (line 98) | private static int counta2z(String string) {
method countOtherCharacter (line 115) | private static int countOtherCharacter(String string) {
FILE: src/main/java/com/basic/chapter0500/Chapter0504TestString.java
class Chapter0504TestString (line 4) | public class Chapter0504TestString {
method main (line 5) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0500/Chapter0505StringBuffer.java
class Chapter0505StringBuffer (line 9) | public class Chapter0505StringBuffer {
method main (line 10) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0500/Chapter0506BasicTypeWrap.java
class Chapter0506BasicTypeWrap (line 9) | public class Chapter0506BasicTypeWrap {
method main (line 10) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0500/Chapter0507ArrayParser.java
class Chapter0507ArrayParser (line 9) | public class Chapter0507ArrayParser {
method main (line 10) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0500/Chapter0508TestMath.java
class Chapter0508TestMath (line 10) | public class Chapter0508TestMath {
method main (line 11) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0500/Chapter0509TestFile.java
class Chapter0509TestFile (line 12) | public class Chapter0509TestFile {
method main (line 13) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0500/Chapter0510FileList.java
class Chapter0510FileList (line 8) | public class Chapter0510FileList {
method main (line 9) | public static void main(String[] args) {
method tree (line 15) | private static void tree(File f, int level) {
FILE: src/main/java/com/basic/chapter0500/Chapter0511TestEnum.java
class Chapter0511TestEnum (line 11) | public class Chapter0511TestEnum {
type MyColor (line 12) | public enum MyColor { red, green, blue }
type MyDoorOpener (line 13) | public enum MyDoorOpener {me, mywife}
method main (line 15) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0600/BasicContainer.java
class BasicContainer (line 10) | public class BasicContainer {
method main (line 11) | public static void main(String[] args) {
class Name (line 24) | class Name implements Comparable {
method Name (line 27) | public Name(String firstName, String lastName) {
method getFirstName (line 32) | public String getFirstName() {
method getLastName (line 36) | public String getLastName() {
method toString (line 40) | public String toString() {
method equals (line 50) | public boolean equals(Object obj) {
method hashCode (line 71) | public int hashCode() {
method compareTo (line 75) | public int compareTo(Object o) {
FILE: src/main/java/com/basic/chapter0600/BasicGeneric.java
class BasicGeneric (line 12) | public class BasicGeneric {
method main (line 13) | public static void main(String[] args) {
class MyName (line 53) | class MyName implements Comparable<MyName> {
method compareTo (line 56) | public int compareTo(MyName mn) {
FILE: src/main/java/com/basic/chapter0600/CollectionsTest.java
class CollectionsTest (line 13) | public class CollectionsTest {
method main (line 14) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0600/DataStructureSelection.java
class DataStructureSelection (line 6) | public class DataStructureSelection {
method main (line 7) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0600/EnhancedFor.java
class EnhancedFor (line 5) | public class EnhancedFor {
method main (line 6) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0600/IteratorTest.java
class IteratorTest (line 13) | public class IteratorTest {
method main (line 14) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0600/SetTest.java
class SetTest (line 12) | public class SetTest {
method main (line 13) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0600/TestArgsWords.java
class TestArgsWords (line 13) | public class TestArgsWords {
method main (line 17) | public static void main(String args[]) {
FILE: src/main/java/com/basic/chapter0600/TestArgsWords2.java
class TestArgsWords2 (line 5) | public class TestArgsWords2 {
method main (line 8) | public static void main(String args[]) {
FILE: src/main/java/com/basic/chapter0600/TestMap.java
class TestMap (line 14) | public class TestMap {
method main (line 15) | public static void main(String args[]) {
FILE: src/main/java/com/basic/chapter0600/TestMap2.java
class TestMap2 (line 10) | public class TestMap2 {
method main (line 11) | public static void main(String args[]) {
FILE: src/main/java/com/basic/chapter0700/FileCopy.java
class FileCopy (line 5) | public class FileCopy {
method main (line 6) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0700/HelloWorld.java
class HelloWorld (line 16) | public class HelloWorld {
method main (line 20) | public static void main(String[] asdfasf) {
method m (line 27) | public static void m() {
class TT (line 32) | class TT {
FILE: src/main/java/com/basic/chapter0700/TestBufferStream1.java
class TestBufferStream1 (line 5) | public class TestBufferStream1 {
method main (line 6) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0700/TestBufferStream2.java
class TestBufferStream2 (line 5) | public class TestBufferStream2 {
method main (line 6) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0700/TestDataStream.java
class TestDataStream (line 5) | public class TestDataStream {
method main (line 6) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0700/TestFileInputStream.java
class TestFileInputStream (line 5) | public class TestFileInputStream {
method main (line 6) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0700/TestFileOutputStream.java
class TestFileOutputStream (line 5) | public class TestFileOutputStream {
method main (line 6) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0700/TestFileReader.java
class TestFileReader (line 5) | public class TestFileReader {
method main (line 6) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0700/TestFileWriter.java
class TestFileWriter (line 5) | public class TestFileWriter {
method main (line 6) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0700/TestFileWriter2.java
class TestFileWriter2 (line 5) | public class TestFileWriter2 {
method main (line 6) | public static void main(String[] args) throws Exception {
FILE: src/main/java/com/basic/chapter0700/TestObjectIO.java
class TestObjectIO (line 5) | public class TestObjectIO {
method main (line 6) | public static void main(String args[]) throws Exception {
class T (line 22) | class T implements Serializable {
FILE: src/main/java/com/basic/chapter0700/TestPrintStream1.java
class TestPrintStream1 (line 5) | public class TestPrintStream1 {
method main (line 6) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0700/TestPrintStream2.java
class TestPrintStream2 (line 5) | public class TestPrintStream2 {
method main (line 6) | public static void main(String[] args) {
method list (line 13) | public static void list(String f, PrintStream fs) {
FILE: src/main/java/com/basic/chapter0700/TestPrintStream3.java
class TestPrintStream3 (line 6) | public class TestPrintStream3 {
method main (line 7) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0700/TestTransForm1.java
class TestTransForm1 (line 5) | public class TestTransForm1 {
method main (line 6) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0700/TestTransForm2.java
class TestTransForm2 (line 5) | public class TestTransForm2 {
method main (line 6) | public static void main(String args[]) {
FILE: src/main/java/com/basic/chapter0700/TreeDir.java
class TreeDir (line 5) | public class TreeDir {
method main (line 6) | public static void main(String[] args) {
method listF (line 10) | public static void listF(File f, int level) {
FILE: src/main/java/com/basic/chapter0800/ProducerConsumer.java
class ProducerConsumer (line 3) | public class ProducerConsumer {
method main (line 4) | public static void main(String[] args) {
class WoTou (line 15) | class WoTou {
method WoTou (line 17) | WoTou(int id) {
method toString (line 20) | public String toString() {
class SyncStack (line 25) | class SyncStack {
method push (line 29) | public synchronized void push(WoTou wt) {
method pop (line 42) | public synchronized WoTou pop() {
class Producer (line 56) | class Producer implements Runnable {
method Producer (line 58) | Producer(SyncStack ss) {
method run (line 62) | public void run() {
class Consumer (line 76) | class Consumer implements Runnable {
method Consumer (line 78) | Consumer(SyncStack ss) {
method run (line 82) | public void run() {
FILE: src/main/java/com/basic/chapter0800/ProducerConsumer2.java
class ProducerConsumer2 (line 3) | public class ProducerConsumer2 {
method main (line 4) | public static void main(String args[]) {
class SyncStack2 (line 16) | class SyncStack2 {
method push (line 20) | public synchronized void push(char c) {
method pop (line 32) | public synchronized char pop() {
class Producer2 (line 46) | class Producer2 implements Runnable {
method Producer2 (line 49) | public Producer2(SyncStack2 s) {
method run (line 53) | public void run() {
class Consumer2 (line 67) | class Consumer2 implements Runnable {
method Consumer2 (line 70) | public Consumer2(SyncStack2 s) {
method run (line 74) | public void run() {
FILE: src/main/java/com/basic/chapter0800/RecursiveFile.java
class RecursiveFile (line 3) | public class RecursiveFile {
method main (line 4) | public static void main(String[] args) {
method f (line 8) | public static void f() {
FILE: src/main/java/com/basic/chapter0800/T.java
class T (line 3) | public class T {
method main (line 4) | public static void main(String[] args) {
method m1 (line 8) | public static void m1() {
method m2 (line 13) | public static void m2() {
method m3 (line 16) | public static void m3() {
FILE: src/main/java/com/basic/chapter0800/TT.java
class TT (line 3) | public class TT implements Runnable {
method m1 (line 6) | public synchronized void m1() throws Exception {
method m2 (line 13) | public synchronized void m2() throws Exception {
method run (line 18) | public void run() {
method main (line 26) | public static void main(String[] args) throws Exception {
FILE: src/main/java/com/basic/chapter0800/Test.java
class Test (line 5) | public class Test {
method main (line 6) | public static void main(String[] args) throws Exception {
FILE: src/main/java/com/basic/chapter0800/TestDeadLock.java
class TestDeadLock (line 3) | public class TestDeadLock implements Runnable {
method run (line 6) | public void run() {
method main (line 34) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0800/TestInterrupt.java
class TestInterrupt (line 5) | public class TestInterrupt {
method main (line 6) | public static void main(String[] args) {
class MyThread (line 17) | class MyThread extends Thread {
method run (line 20) | public void run() {
FILE: src/main/java/com/basic/chapter0800/TestJoin.java
class TestJoin (line 3) | public class TestJoin {
method main (line 4) | public static void main(String[] args) {
class MyThread2 (line 18) | class MyThread2 extends Thread {
method MyThread2 (line 19) | MyThread2(String s) {
method run (line 23) | public void run() {
FILE: src/main/java/com/basic/chapter0800/TestPriority.java
class TestPriority (line 3) | public class TestPriority {
method main (line 4) | public static void main(String[] args) {
class T1 (line 13) | class T1 implements Runnable {
method run (line 14) | public void run() {
class T2 (line 21) | class T2 implements Runnable {
method run (line 22) | public void run() {
FILE: src/main/java/com/basic/chapter0800/TestSync.java
class TestSync (line 3) | public class TestSync implements Runnable {
method main (line 6) | public static void main(String[] args) {
method run (line 16) | public void run() {
class Timer (line 21) | class Timer {
method add (line 24) | public synchronized void add(String name) {
FILE: src/main/java/com/basic/chapter0800/TestThread1.java
class TestThread1 (line 3) | public class TestThread1 {
method main (line 4) | public static void main(String args[]) {
class Runner1 (line 18) | class Runner1 extends Thread {
method run (line 19) | public void run() {
FILE: src/main/java/com/basic/chapter0800/TestThread2.java
class TestThread2 (line 3) | public class TestThread2 {
method main (line 4) | public static void main(String args[]) {
class Runner2 (line 13) | class Runner2 implements Runnable {
method run (line 14) | public void run() {
FILE: src/main/java/com/basic/chapter0800/TestThread3.java
class TestThread3 (line 3) | public class TestThread3 {
method main (line 4) | public static void main(String args[]) {
class Runner3 (line 11) | class Runner3 implements Runnable {
method run (line 12) | public void run() {
FILE: src/main/java/com/basic/chapter0800/TestThread4.java
class TestThread4 (line 3) | public class TestThread4 {
method main (line 4) | public static void main(String args[]) {
class Runner4 (line 18) | class Runner4 implements Runnable {
method run (line 21) | public void run() {
method shutDown (line 28) | public void shutDown() {
FILE: src/main/java/com/basic/chapter0800/TestThread5.java
class TestThread5 (line 3) | public class TestThread5 {
method main (line 4) | public static void main(String args[]){
class Runner5 (line 20) | class Runner5 implements Runnable {
method run (line 21) | public void run() {
FILE: src/main/java/com/basic/chapter0800/TestThread6.java
class TestThread6 (line 3) | public class TestThread6 {
method main (line 4) | public static void main(String args[]) {
class Runner6 (line 14) | class Runner6 extends Thread {
method run (line 15) | public void run() {
FILE: src/main/java/com/basic/chapter0800/TestYield.java
class TestYield (line 3) | public class TestYield {
method main (line 4) | public static void main(String[] args) {
class MyThread3 (line 12) | class MyThread3 extends Thread {
method MyThread3 (line 13) | MyThread3(String s) {
method run (line 17) | public void run() {
FILE: src/main/java/com/basic/chapter0900/Chapter0901TestUDPClient.java
class Chapter0901TestUDPClient (line 5) | public class Chapter0901TestUDPClient {
method main (line 6) | public static void main(String args[]) throws Exception {
FILE: src/main/java/com/basic/chapter0900/Chapter0901TestUDPServer.java
class Chapter0901TestUDPServer (line 5) | public class Chapter0901TestUDPServer {
method main (line 6) | public static void main(String args[]) throws Exception {
FILE: src/main/java/com/basic/chapter0900/Chat/Chat03/ChatClient.java
class ChatClient (line 6) | public class ChatClient {
method ChatClient (line 9) | public ChatClient() throws Exception {
method send (line 13) | public void send(String str) throws Exception {
method disconnect (line 18) | public void disconnect() throws Exception {
method main (line 22) | public static void main(String[] args) throws Exception {
FILE: src/main/java/com/basic/chapter0900/Chat/Chat03/ChatServer.java
class ChatServer (line 7) | public class ChatServer {
method ChatServer (line 11) | public ChatServer(int port) throws Exception {
method startServer (line 15) | public void startServer() throws Exception {
class ClientConn (line 22) | class ClientConn implements Runnable {
method ClientConn (line 25) | public ClientConn(Socket s) {
method run (line 30) | public void run() {
method main (line 53) | public static void main(String[] args) throws Exception {
FILE: src/main/java/com/basic/chapter0900/Chat/Chat05/ChatClient.java
class ChatClient (line 6) | public class ChatClient {
method ChatClient (line 9) | public ChatClient() throws Exception {
method send (line 14) | public void send(String str) throws Exception {
method disconnect (line 19) | public void disconnect() throws Exception {
method main (line 23) | public static void main(String[] args) throws Exception {
class ReceiveThread (line 34) | class ReceiveThread implements Runnable {
method run (line 35) | public void run() {
FILE: src/main/java/com/basic/chapter0900/Chat/Chat05/ChatServer.java
class ChatServer (line 7) | public class ChatServer {
method ChatServer (line 11) | public ChatServer(int port) throws Exception {
method startServer (line 15) | public void startServer() throws Exception {
class ClientConn (line 22) | class ClientConn implements Runnable {
method ClientConn (line 25) | public ClientConn(Socket s) {
method send (line 30) | public void send(String str) throws IOException {
method run (line 35) | public void run() {
method main (line 65) | public static void main(String[] args) throws Exception {
FILE: src/main/java/com/basic/chapter0900/Chat/Chat07/ChatClient.java
class ChatClient (line 8) | public class ChatClient extends Frame {
method launchFrame (line 12) | public void launchFrame() throws Exception {
method ChatClient (line 34) | public ChatClient() throws Exception {
method send (line 40) | public void send(String str) throws Exception {
method disconnect (line 45) | public void disconnect() throws Exception {
method main (line 49) | public static void main(String[] args) throws Exception {
class ReceiveThread (line 60) | class ReceiveThread implements Runnable {
method run (line 61) | public void run() {
FILE: src/main/java/com/basic/chapter0900/Chat/Chat07/ChatServer.java
class ChatServer (line 7) | public class ChatServer {
method ChatServer (line 11) | public ChatServer(int port) throws Exception {
method startServer (line 15) | public void startServer() throws Exception {
class ClientConn (line 22) | class ClientConn implements Runnable {
method ClientConn (line 25) | public ClientConn(Socket s) {
method send (line 30) | public void send(String str) throws IOException {
method run (line 35) | public void run() {
method main (line 66) | public static void main(String[] args) throws Exception {
FILE: src/main/java/com/basic/chapter0900/Chat/Chat10/ChatClient.java
class ChatClient (line 8) | public class ChatClient extends Frame {
method launchFrame (line 12) | public void launchFrame() throws Exception {
method ChatClient (line 41) | public ChatClient() throws Exception {
method send (line 47) | public void send(String str) throws Exception {
method disconnect (line 52) | public void disconnect() throws Exception {
method main (line 56) | public static void main(String[] args) throws Exception {
class ReceiveThread (line 67) | class ReceiveThread implements Runnable {
method run (line 68) | public void run() {
FILE: src/main/java/com/basic/chapter0900/Chat/Chat10/ChatServer.java
class ChatServer (line 9) | public class ChatServer extends Frame {
method launchFrame (line 12) | public void launchFrame() {
method ChatServer (line 28) | public ChatServer(int port) throws Exception {
method startServer (line 33) | public void startServer() throws Exception {
class ClientConn (line 42) | class ClientConn implements Runnable {
method ClientConn (line 45) | public ClientConn(Socket s) {
method send (line 50) | public void send(String str) throws IOException {
method dispose (line 55) | public void dispose() {
method run (line 66) | public void run() {
method main (line 89) | public static void main(String[] args) throws Exception {
FILE: src/main/java/com/basic/chapter0900/TCPClient.java
class TCPClient (line 6) | public class TCPClient {
method main (line 7) | public static void main(String[] args) throws Exception {
FILE: src/main/java/com/basic/chapter0900/TCPServer.java
class TCPServer (line 6) | public class TCPServer {
method main (line 7) | public static void main(String[] args) throws Exception {
FILE: src/main/java/com/basic/chapter0900/TalkClient.java
class TalkClient (line 6) | public class TalkClient {
method main (line 7) | public static void main(String args[]) {
FILE: src/main/java/com/basic/chapter0900/TalkServer.java
class TalkServer (line 7) | public class TalkServer {
method main (line 8) | public static void main(String args[]) {
FILE: src/main/java/com/basic/chapter0900/TestClient.java
class TestClient (line 6) | public class TestClient {
method main (line 7) | public static void main(String args[]) {
FILE: src/main/java/com/basic/chapter0900/TestServer.java
class TestServer (line 6) | public class TestServer {
method main (line 7) | public static void main(String args[]) {
FILE: src/main/java/com/basic/chapter0900/TestSockClient.java
class TestSockClient (line 6) | public class TestSockClient {
method main (line 7) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0900/TestSockServer.java
class TestSockServer (line 1) | public class TestSockServer {
public static void main(String[] args)...
method main (line 1) | public static void main(String[] args) {
InputStream in = null...
FILE: src/main/java/com/basic/chapter0900/TestUDPClient.java
class TestUDPClient (line 6) | public class TestUDPClient {
method main (line 7) | public static void main(String args[]) throws Exception {
FILE: src/main/java/com/basic/chapter0900/TestUDPServer.java
class TestUDPServer (line 6) | public class TestUDPServer {
method main (line 7) | public static void main(String args[]) throws Exception {
FILE: src/main/java/com/basic/chapter0900/zerocopy/traditonal/TraditionalClient.java
class TraditionalClient (line 9) | public class TraditionalClient {
method main (line 10) | public static void main(String[] args) {
FILE: src/main/java/com/basic/chapter0900/zerocopy/traditonal/TraditionalServer.java
class TraditionalServer (line 8) | public class TraditionalServer {
method main (line 9) | public static void main(String args[]) {
FILE: src/main/java/com/basic/chapter0900/zerocopy/transfer/TransferToClient.java
class TransferToClient (line 10) | public class TransferToClient {
method main (line 12) | public static void main(String[] args) throws IOException {
method testSendfile (line 17) | public void testSendfile() throws IOException {
FILE: src/main/java/com/basic/chapter0900/zerocopy/transfer/TransferToServer.java
class TransferToServer (line 10) | public class TransferToServer {
method mySetup (line 13) | protected void mySetup() {
method main (line 29) | public static void main(String[] args) {
method readData (line 35) | private void readData() {
FILE: src/main/java/com/basic/chapter1000/AWTDrawing.java
class AWTDrawing (line 5) | public class AWTDrawing {
method launchFrame (line 8) | public void launchFrame() {
method main (line 18) | public static void main( String args[]) {
FILE: src/main/java/com/basic/chapter1000/AWTDrawing2.java
class SubPanel (line 5) | class SubPanel extends Panel{
method paint (line 6) | public void paint(Graphics g){
class AWTDrawing2 (line 13) | public class AWTDrawing2 {
method launchFrame (line 16) | public void launchFrame() {
method main (line 22) | public static void main( String args[]) {
FILE: src/main/java/com/basic/chapter1000/CenterPanel.java
class CenterPanel (line 5) | public class CenterPanel {
method main (line 6) | public static void main(String args[]) {
class MyFrame3 (line 11) | class MyFrame3 extends Frame {
method MyFrame3 (line 14) | MyFrame3(int x, int y, int w, int h, Color c) {
FILE: src/main/java/com/basic/chapter1000/MyMouseAdapter.java
class MyMouseAdapter (line 7) | public class MyMouseAdapter {
method main (line 8) | public static void main(String args[]) {
class MyFrame (line 13) | class MyFrame extends Frame {
method MyFrame (line 16) | MyFrame(String s) {
method paint (line 26) | public void paint(Graphics g) {
method addPoint (line 35) | public void addPoint(Point p) {
class Monitor (line 40) | class Monitor extends MouseAdapter {
method mousePressed (line 41) | public void mousePressed(MouseEvent e) {
FILE: src/main/java/com/basic/chapter1000/MyMouseAdapterGeneric.java
class MyMouseAdapterGeneric (line 7) | public class MyMouseAdapterGeneric {
method main (line 8) | public static void main(String args[]) {
class MyFrame992 (line 13) | class MyFrame992 extends Frame {
method MyFrame992 (line 16) | MyFrame992(String s) {
method paint (line 26) | public void paint(Graphics g) {
method addPoint (line 35) | public void addPoint(Point p) {
class Monitor2 (line 40) | class Monitor2 extends MouseAdapter {
method mousePressed (line 41) | public void mousePressed(MouseEvent e) {
FILE: src/main/java/com/basic/chapter1000/NestedContainer.java
class NestedContainer (line 5) | public class NestedContainer {
method main (line 6) | public static void main(String args[]) {
FILE: src/main/java/com/basic/chapter1000/TFActionEvent.java
class TFActionEvent (line 6) | public class TFActionEvent {
method main (line 10) | public static void main(String[] args) {
class TFFrame (line 15) | class TFFrame extends Frame {
method TFFrame (line 16) | TFFrame() {
class TFActionListener (line 25) | class TFActionListener implements ActionListener {
method actionPerformed (line 26) | public void actionPerformed(ActionEvent e) {
FILE: src/main/java/com/basic/chapter1000/TFMath.java
class TFMath (line 6) | public class TFMath {
method main (line 7) | public static void main(String[] args) {
class TFFrame3 (line 12) | class TFFrame3 extends Frame {
method launchFrame (line 15) | public void launchFrame() {
class MyMonitor (line 32) | private class MyMonitor implements ActionListener {
method actionPerformed (line 33) | public void actionPerformed(ActionEvent e) {
FILE: src/main/java/com/basic/chapter1000/TFMathTest.java
class TFMathTest (line 6) | public class TFMathTest extends Frame {
method main (line 14) | public static void main(String[] args) {
method launchFrame (line 18) | public void launchFrame() {
class MyListener2 (line 40) | class MyListener2 implements ActionListener {
method MyListener2 (line 43) | public MyListener2(TFMathTest tfmt) {
method actionPerformed (line 47) | public void actionPerformed(ActionEvent e) {
FILE: src/main/java/com/basic/chapter1000/TFMathTest2.java
class TFMathTest2 (line 6) | public class TFMathTest2 extends Frame {
method main (line 14) | public static void main(String[] args) {
method launchFrame (line 18) | public void launchFrame() {
class MyListener (line 40) | class MyListener implements ActionListener {
method MyListener (line 45) | public MyListener(TFMathTest2 tfmt) {
method MyListener (line 55) | public MyListener(TextField num1, TextField num2, TextField sum) {
method actionPerformed (line 61) | public void actionPerformed(ActionEvent e) {
FILE: src/main/java/com/basic/chapter1000/TFPassword.java
class TFPassword (line 6) | public class TFPassword {
method main (line 11) | public static void main(String[] args) {
class TFFrame2 (line 16) | class TFFrame2 extends Frame {
method TFFrame2 (line 17) | TFFrame2() {
class TFActionListener2 (line 27) | class TFActionListener2 implements ActionListener {
method actionPerformed (line 28) | public void actionPerformed(ActionEvent e) {
FILE: src/main/java/com/basic/chapter1000/TenButtons.java
class TenButtons (line 5) | public class TenButtons {
method main (line 6) | public static void main(String args[]) {
FILE: src/main/java/com/basic/chapter1000/Test.java
class Test (line 5) | public class Test {
method main (line 6) | public static void main(String args[]) {
FILE: src/main/java/com/basic/chapter1000/TestActionEvent.java
class TestActionEvent (line 6) | public class TestActionEvent {
method main (line 7) | public static void main(String args[]) {
class Monitor3 (line 18) | class Monitor3 implements ActionListener {
method actionPerformed (line 19) | public void actionPerformed(ActionEvent e) {
FILE: src/main/java/com/basic/chapter1000/TestActionEvent2.java
class TestActionEvent2 (line 6) | public class TestActionEvent2 {
method main (line 7) | public static void main(String args[]) {
class Monitor6 (line 22) | class Monitor6 implements ActionListener {
method actionPerformed (line 23) | public void actionPerformed(ActionEvent e) {
FILE: src/main/java/com/basic/chapter1000/TestAnonymous.java
class TestAnonymous (line 6) | public class TestAnonymous {
method TestAnonymous (line 10) | public TestAnonymous() {
method main (line 28) | public static void main(String args[]) {
FILE: src/main/java/com/basic/chapter1000/TestAnonymous2.java
class TestAnonymous2 (line 6) | public class TestAnonymous2 {
method TestAnonymous2 (line 11) | public TestAnonymous2() {
method main (line 33) | public static void main(String args[]) {
FILE: src/main/java/com/basic/chapter1000/TestBorderLayout.java
class TestBorderLayout (line 5) | public class TestBorderLayout {
method main (line 6) | public static void main(String args[]) {
FILE: src/main/java/com/basic/chapter1000/TestFlowLayout.java
class TestFlowLayout (line 5) | public class TestFlowLayout {
method main (line 6) | public static void main(String args[]) {
FILE: src/main/java/com/basic/chapter1000/TestFlowLayout2.java
class TestFlowLayout2 (line 5) | public class TestFlowLayout2 {
method main (line 6) | public static void main(String args[]) {
FILE: src/main/java/com/basic/chapter1000/TestFrame.java
class TestFrame (line 4) | public class TestFrame {
method main (line 5) | public static void main( String args[]) {
FILE: src/main/java/com/basic/chapter1000/TestFrameWithPanel.java
class TestFrameWithPanel (line 5) | public class TestFrameWithPanel {
method main (line 6) | public static void main(String args[]) {
FILE: src/main/java/com/basic/chapter1000/TestGridLayout.java
class TestGridLayout (line 5) | public class TestGridLayout {
method main (line 6) | public static void main(String args[]) {
FILE: src/main/java/com/basic/chapter1000/TestInner.java
class TestInner (line 6) | public class TestInner {
method TestInner (line 10) | public TestInner() {
method main (line 20) | public static void main(String args[]) {
class InnerMonitor (line 24) | private class InnerMonitor implements MouseMotionListener, MouseListen...
method mouseDragged (line 25) | public void mouseDragged(MouseEvent e) {
method mouseEntered (line 30) | public void mouseEntered(MouseEvent e) {
method mouseExited (line 35) | public void mouseExited(MouseEvent e) {
method mouseMoved (line 40) | public void mouseMoved(MouseEvent e) {
method mousePressed (line 43) | public void mousePressed(MouseEvent e) {
method mouseClicked (line 46) | public void mouseClicked(MouseEvent e) {
method mouseReleased (line 49) | public void mouseReleased(MouseEvent e) {
FILE: src/main/java/com/basic/chapter1000/TestKey.java
class TestKey (line 6) | public class TestKey {
method main (line 7) | public static void main(String[] args) {
class KeyFrame (line 12) | class KeyFrame extends Frame {
method launchFrame (line 13) | public void launchFrame() {
class MyKeyMonitor (line 20) | class MyKeyMonitor extends KeyAdapter {
method keyPressed (line 21) | public void keyPressed(KeyEvent e) {
FILE: src/main/java/com/basic/chapter1000/TestMouseMotion.java
class TestMouseMotion (line 7) | public class TestMouseMotion {
method main (line 8) | public static void main(String args[]) {
class MyFrame88 (line 13) | class MyFrame88 extends Frame {
method MyFrame88 (line 16) | MyFrame88(String s) {
method paint (line 26) | public void paint(Graphics g) {
method addPoint (line 35) | public void addPoint(Point p) {
class Monitor5 (line 40) | class Monitor5 extends MouseMotionAdapter {
method mouseMoved (line 43) | public void mouseMoved(MouseEvent e) {
FILE: src/main/java/com/basic/chapter1000/TestMouseMotionGeneric.java
class TestMouseMotionGeneric (line 7) | public class TestMouseMotionGeneric {
method main (line 8) | public static void main(String args[]) {
class MyFrame888 (line 13) | class MyFrame888 extends Frame {
method MyFrame888 (line 16) | MyFrame888(String s) {
method paint (line 26) | public void paint(Graphics g) {
method addPoint (line 35) | public void addPoint(Point p) {
class Monitor4 (line 40) | class Monitor4 extends MouseMotionAdapter {
method mouseMoved (line 43) | public void mouseMoved(MouseEvent e) {
FILE: src/main/java/com/basic/chapter1000/TestMultiFrame.java
class TestMultiFrame (line 5) | public class TestMultiFrame {
method main (line 6) | public static void main(String args[]) {
class MyFrame4 (line 19) | class MyFrame4 extends Frame {
method MyFrame4 (line 22) | MyFrame4(int x, int y, int w, int h, Color color) {
FILE: src/main/java/com/basic/chapter1000/TestMultiPanel.java
class TestMultiPanel (line 5) | public class TestMultiPanel {
method main (line 6) | public static void main(String args[]) {
class MyFrame2 (line 12) | class MyFrame2 extends Frame {
method MyFrame2 (line 15) | MyFrame2(String s, int x, int y, int w, int h) {
FILE: src/main/java/com/basic/chapter1000/TestPaint.java
class TestPaint (line 5) | public class TestPaint {
method main (line 6) | public static void main(String[] args) {
class PaintFrame (line 11) | class PaintFrame extends Frame {
method launchFrame (line 13) | public void launchFrame() {
method paint (line 18) | public void paint(Graphics g) {
FILE: src/main/java/com/basic/chapter1000/TestPanel.java
class TestPanel (line 5) | public class TestPanel {
method main (line 6) | public static void main(String args[]) {
FILE: src/main/java/com/basic/chapter1000/TestWindowClose.java
class TestWindowClose (line 6) | public class TestWindowClose {
method main (line 7) | public static void main(String args[]) {
class MyFrame55 (line 12) | class MyFrame55 extends Frame {
method MyFrame55 (line 13) | MyFrame55(String s) {
FILE: src/main/java/com/basic/chapter1100/TestReflect.java
class TestReflect (line 11) | public class TestReflect {
method main (line 12) | public static void main(String[] args) throws Exception {
method m1 (line 27) | private static void m1() {
method m2 (line 36) | private static void m2() {
method m3 (line 41) | private static void m3(String className) {
method m4 (line 49) | private static void m4() {
method m5 (line 56) | private static void m5() {
method m6 (line 63) | private static void m6() {
method m7 (line 70) | private static void m7() throws Exception {
method m8 (line 83) | private static void m8() throws Exception {
method m9 (line 91) | private static void m9() throws Exception {
method m10 (line 99) | private static void m10() throws Exception {
FILE: src/main/java/com/basic/chapter1200/QQClient.java
class QQClient (line 3) | public class QQClient {
FILE: src/main/java/com/basic/chapter1200/QQServer.java
class QQServer (line 3) | public class QQServer {
FILE: src/main/java/com/geo/GeoTest.java
class GeoTest (line 17) | public class GeoTest {
method main (line 25) | public static void main(String[] args) throws Exception {
FILE: src/main/java/com/java10/NewFeatures.java
class NewFeatures (line 11) | public class NewFeatures {
method main (line 12) | public static void main(String[] args) {
FILE: src/main/java/com/java11/NewFeatures.java
class NewFeatures (line 11) | public class NewFeatures {
method main (line 12) | public static void main(String[] args) {
FILE: src/main/java/com/java12/NewFeatures.java
class NewFeatures (line 11) | public class NewFeatures {
method main (line 12) | public static void main(String[] args) {
FILE: src/main/java/com/java13/NewFeatures.java
class NewFeatures (line 11) | public class NewFeatures {
method main (line 12) | public static void main(String[] args) {
FILE: src/main/java/com/java14/Java14NewFeatures.java
class Java14NewFeatures (line 9) | public class Java14NewFeatures {
method main (line 10) | public static void main(String[] args) {
FILE: src/main/java/com/java15/NewFeatures.java
class NewFeatures (line 11) | public class NewFeatures {
method main (line 12) | public static void main(String[] args) {
FILE: src/main/java/com/java16/Java16NewFeatures.java
class Java16NewFeatures (line 9) | public class Java16NewFeatures {
method main (line 10) | public static void main(String[] args) {
FILE: src/main/java/com/java17/Java17NewFeatures.java
class Java17NewFeatures (line 10) | public class Java17NewFeatures {
method main (line 11) | public static void main(String[] args) {
FILE: src/main/java/com/java18/Java18Features.java
class Java18Features (line 8) | public class Java18Features {
method main (line 9) | public static void main(String[] args) {
FILE: src/main/java/com/java19/Java19Features.java
class Java19Features (line 8) | public class Java19Features {
method main (line 9) | public static void main(String[] args) {
FILE: src/main/java/com/java5/NewFeatures.java
class NewFeatures (line 14) | public class NewFeatures {
method print (line 15) | public static void print(int ...is) {
method main (line 21) | public static void main(String[] args) {
FILE: src/main/java/com/java6/NewFeatures.java
class NewFeatures (line 11) | public class NewFeatures {
method main (line 12) | public static void main(String[] args) {
FILE: src/main/java/com/java7/NewFeatures.java
class NewFeatures (line 11) | public class NewFeatures {
method main (line 12) | public static void main(String[] args) {
FILE: src/main/java/com/java8/Demo0100_LambdaRunnable.java
class Demo0100_LambdaRunnable (line 6) | public class Demo0100_LambdaRunnable {
method main (line 7) | public static void main(String[] args) {
FILE: src/main/java/com/java8/Demo0200_LambdaIterator.java
class Demo0200_LambdaIterator (line 9) | public class Demo0200_LambdaIterator {
method main (line 10) | public static void main(String[] args) {
FILE: src/main/java/com/java8/Demo0300_LambdaPredicate.java
class Demo0300_LambdaPredicate (line 10) | public class Demo0300_LambdaPredicate {
method main (line 11) | public static void main(String[] args) {
method filter (line 44) | public static void filter(List<String> names, Predicate condition) {
method betterFilter (line 53) | public static void betterFilter(List names, Predicate condition) {
FILE: src/main/java/com/java8/Demo0400_LambdaMapReduce.java
class Demo0400_LambdaMapReduce (line 11) | public class Demo0400_LambdaMapReduce {
method main (line 12) | public static void main(String[] args) {
FILE: src/main/java/com/java8/Demo0500_LambdaSimpleDemo.java
class Demo0500_LambdaSimpleDemo (line 6) | public class Demo0500_LambdaSimpleDemo {
method main (line 7) | public static void main(String[] args) {
type MathOperation (line 54) | interface MathOperation {
method operation (line 55) | int operation(int a, int b);
type GreetingService (line 58) | interface GreetingService {
method sayMessage (line 59) | void sayMessage(String message);
method operate (line 62) | private int operate(int a, int b, MathOperation mathOperation) {
FILE: src/main/java/com/java8/Demo0600_Stream.java
class Demo0600_Stream (line 13) | public class Demo0600_Stream {
method main (line 14) | public static void main(String[] args) {
FILE: src/main/java/com/java8/Demo0700_Stream.java
class Demo0700_Stream (line 14) | public class Demo0700_Stream {
method main (line 15) | public static void main(String[] args) {
FILE: src/main/java/com/java8/Demo0800_Stream.java
class Demo0800_Stream (line 6) | public class Demo0800_Stream {
method main (line 7) | public static void main(String[] args) {
FILE: src/main/java/com/java8/NewFeatures.java
class NewFeatures (line 15) | public class NewFeatures {
method main (line 16) | public static void main(String[] args) {
FILE: src/main/java/com/java8/Person.java
class Person (line 3) | public class Person {
method Person (line 9) | public Person() {}
method Person (line 11) | public Person(int id, String name) {
method Person (line 16) | public Person(int id, String name, int age, int sex) {
method getId (line 23) | public int getId() {
method setId (line 27) | public void setId(int id) {
method getName (line 31) | public String getName() {
method setName (line 35) | public void setName(String name) {
method getAge (line 39) | public int getAge() {
method setAge (line 43) | public void setAge(int age) {
method getSex (line 47) | public int getSex() {
method setSex (line 51) | public void setSex(int sex) {
method toString (line 55) | @Override
FILE: src/main/java/com/java9/NewFeatures.java
class NewFeatures (line 11) | public class NewFeatures {
method main (line 12) | public static void main(String[] args) {
FILE: src/main/java/com/jvm/OutOfMemoryException.java
class OutOfMemoryException (line 11) | public class OutOfMemoryException {
method main (line 14) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent01/T.java
class T (line 8) | public class T {
method m (line 13) | public void m() {
FILE: src/main/java/com/mark/concurrent02/T.java
class T (line 8) | public class T {
method m (line 12) | public void m() {
FILE: src/main/java/com/mark/concurrent02/T2.java
class T2 (line 7) | public class T2 implements Runnable {
method run (line 11) | @Override
method main (line 20) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent03/T.java
class T (line 8) | public class T {
method m (line 12) | public synchronized void m() { // 等同于 synchronized(this), 锁定当前对象
FILE: src/main/java/com/mark/concurrent04/T.java
class T (line 8) | public class T {
method m (line 12) | public synchronized static void m() { // 等同于synchronized(com.mark.conc...
method mm (line 17) | public static void mm() {
FILE: src/main/java/com/mark/concurrent05/T.java
class T (line 7) | public class T implements Runnable {
method run (line 11) | @Override
method main (line 17) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent06/T.java
class T (line 7) | public class T implements Runnable {
method run (line 11) | @Override
method main (line 17) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent06/T2.java
class T2 (line 9) | public class T2 implements Runnable {
method run (line 13) | @Override
method main (line 19) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent07/T.java
class T (line 9) | public class T {
method m1 (line 11) | public synchronized void m1() {
method m2 (line 21) | public void m2() {
method main (line 30) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent08/Account.java
class Account (line 12) | public class Account {
method set (line 16) | public synchronized void set(String name, double balance) {
method getBalance (line 28) | public /* synchronized */ double getBalance(String name) {
method main (line 32) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent09/T.java
class T (line 11) | public class T implements Runnable {
method run (line 13) | @Override
method m2 (line 24) | synchronized void m2() {
method main (line 33) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent10/T.java
class T (line 9) | public class T {
method m1 (line 10) | synchronized void m1() {
method main (line 20) | public static void main(String[] args) {
class TT (line 25) | class TT extends T {
method m1 (line 26) | @Override
FILE: src/main/java/com/mark/concurrent11/T.java
class T (line 13) | public class T {
method m (line 15) | synchronized void m() {
method main (line 32) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent12/T.java
class T (line 25) | public class T {
method m (line 42) | void m() {
method main (line 54) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent13/T.java
class T (line 15) | public class T {
method m (line 17) | void m() {
method main (line 23) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent14/T.java
class T (line 11) | public class T {
method m (line 13) | synchronized void m() {
method main (line 19) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent15/T.java
class T (line 12) | public class T {
method m (line 17) | void m() {
method main (line 25) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent16/T.java
class T (line 13) | public class T {
method m1 (line 17) | synchronized void m1() {
method m2 (line 33) | void m2() {
method main (line 53) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent17/T.java
class T (line 12) | public class T {
method m (line 16) | void m() {
method main (line 29) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent18/T.java
class T (line 14) | public class T {
method m1 (line 19) | void m1() {
method m2 (line 25) | void m2() {
FILE: src/main/java/com/mark/concurrent19/MyContainer1.java
class MyContainer1 (line 16) | public class MyContainer1 {
method add (line 20) | public void add(Object o) {
method size (line 24) | public int size() {
method main (line 28) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent19/MyContainer2.java
class MyContainer2 (line 22) | public class MyContainer2 {
method add (line 27) | public void add(Object o) {
method size (line 31) | public int size() {
method main (line 35) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent19/MyContainer3.java
class MyContainer3 (line 26) | public class MyContainer3 {
method add (line 31) | public void add(Object o) {
method size (line 35) | public int size() {
method main (line 39) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent19/MyContainer4.java
class MyContainer4 (line 28) | public class MyContainer4 {
method add (line 33) | public void add(Object o) {
method size (line 37) | public int size() {
method main (line 41) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent19/MyContainer5.java
class MyContainer5 (line 37) | public class MyContainer5 {
method add (line 42) | public void add(Object o) {
method size (line 46) | public int size() {
method main (line 50) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent20/ReentrantLock1.java
class ReentrantLock1 (line 12) | public class ReentrantLock1 {
method m1 (line 13) | synchronized void m1() {
method m2 (line 24) | synchronized void m2() {
method main (line 28) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent20/ReentrantLock2.java
class ReentrantLock2 (line 14) | public class ReentrantLock2 {
method m1 (line 16) | void m1() {
method m2 (line 31) | void m2() {
method main (line 37) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent20/ReentrantLock3.java
class ReentrantLock3 (line 13) | public class ReentrantLock3 {
method m1 (line 15) | void m1() {
method m2 (line 36) | synchronized void m2() {
method main (line 53) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent20/ReentrantLock4.java
class ReentrantLock4 (line 14) | public class ReentrantLock4 {
method main (line 16) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent20/ReentrantLock5.java
class ReentrantLock5 (line 11) | public class ReentrantLock5 extends Thread {
method run (line 15) | @Override
method main (line 27) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent21/MyContainer1.java
class MyContainer1 (line 17) | public class MyContainer1<T> {
method put (line 23) | public synchronized void put(T t) {
method get (line 40) | public synchronized T get() {
method main (line 56) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent21/MyContainer2.java
class MyContainer2 (line 21) | public class MyContainer2<T> {
method put (line 32) | public void put(T t) {
method get (line 49) | public T get() {
method main (line 68) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent22/ThreadLocal1.java
class ThreadLocal1 (line 9) | public class ThreadLocal1 {
method main (line 12) | public static void main(String[] args) {
class Person (line 35) | class Person {
FILE: src/main/java/com/mark/concurrent22/ThreadLocal2.java
class ThreadLocal2 (line 19) | public class ThreadLocal2 {
method main (line 22) | public static void main(String[] args) {
class Person (line 44) | static class Person {
FILE: src/main/java/com/mark/concurrent23/Singleton.java
class Singleton (line 10) | public class Singleton {
method Singleton (line 11) | private Singleton() {}
class Inner (line 13) | private static class Inner {
method getInstance (line 17) | public static Singleton getInstance() {
method main (line 21) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent24/TicketSeller1.java
class TicketSeller1 (line 16) | public class TicketSeller1 {
method main (line 23) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent24/TicketSeller2.java
class TicketSeller2 (line 16) | public class TicketSeller2 {
method main (line 23) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent24/TicketSeller3.java
class TicketSeller3 (line 16) | public class TicketSeller3 {
method main (line 23) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent24/TicketSeller4.java
class TicketSeller4 (line 16) | public class TicketSeller4 {
method main (line 23) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent25/T01_ConcurrentMap.java
class T01_ConcurrentMap (line 51) | public class T01_ConcurrentMap {
method main (line 53) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent25/T02_CopyOnWriteList.java
class T02_CopyOnWriteList (line 17) | public class T02_CopyOnWriteList {
method main (line 19) | public static void main(String[] args) {
method runAndComputeTime (line 43) | private static void runAndComputeTime(Thread[] threads) {
FILE: src/main/java/com/mark/concurrent25/T03_SynchronizedList.java
class T03_SynchronizedList (line 10) | public class T03_SynchronizedList {
method main (line 12) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent25/T04_ConcurrentQueue.java
class T04_ConcurrentQueue (line 10) | public class T04_ConcurrentQueue {
method main (line 12) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent25/T05_LinkedBlockingQueue.java
class T05_LinkedBlockingQueue (line 14) | public class T05_LinkedBlockingQueue {
method main (line 19) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent25/T06_ArrayBlockingQueue.java
class T06_ArrayBlockingQueue (line 12) | public class T06_ArrayBlockingQueue {
method main (line 17) | public static void main(String[] args) throws InterruptedException {
FILE: src/main/java/com/mark/concurrent25/T07_DelayQueue.java
class T07_DelayQueue (line 13) | public class T07_DelayQueue {
class MyTask (line 19) | static class MyTask implements Delayed {
method MyTask (line 23) | public MyTask(long runningTime) {
method compareTo (line 27) | @Override
method getDelay (line 37) | @Override
method toString (line 42) | @Override
method main (line 48) | public static void main(String[] args) throws InterruptedException {
FILE: src/main/java/com/mark/concurrent25/T08_TransferQueue.java
class T08_TransferQueue (line 13) | public class T08_TransferQueue {
method main (line 15) | public static void main(String[] args) throws InterruptedException {
FILE: src/main/java/com/mark/concurrent25/T09_SynchronousQueue.java
class T09_SynchronousQueue (line 9) | public class T09_SynchronousQueue {
method main (line 11) | public static void main(String[] args) throws InterruptedException {
FILE: src/main/java/com/mark/concurrent26/T01_MyExecutor.java
class T01_MyExecutor (line 9) | public class T01_MyExecutor implements Executor {
method execute (line 11) | @Override
method main (line 17) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent26/T02_ExecutorService.java
class T02_ExecutorService (line 7) | public class T02_ExecutorService {
FILE: src/main/java/com/mark/concurrent26/T03_Callable.java
class T03_Callable (line 12) | public class T03_Callable implements Callable<String> {
method T03_Callable (line 16) | public T03_Callable(String acceptStr) {
method call (line 20) | @Override
method main (line 28) | public static void main(String[] args) throws Exception {
FILE: src/main/java/com/mark/concurrent26/T04_Executors.java
class T04_Executors (line 11) | public class T04_Executors {
method main (line 12) | public static void main(String[] args) {
FILE: src/main/java/com/mark/concurrent26/T05_ThreadPool.java
class T05_ThreadPool (line 11) | public class T05_ThreadPool {
method main (line 12) | public static void main(String[] args) throws InterruptedException {
FILE: src/main/java/com/mark/concurrent26/T06_Future.java
class T06_Future (line 13) | public class T06_Future {
method main (line 14) | public static void main(String[] args) throws InterruptedException, Ex...
FILE: src/main/java/com/mark/concurrent26/T07_ParallelComputing.java
class T07_ParallelComputing (line 15) | public class T07_ParallelComputing {
method main (line 16) | public static void main(String[] args) throws InterruptedException, Ex...
method getPrime (line 52) | static List<Integer> getPrime(int start, int end) {
method isPrime (line 61) | static boolean isPrime(int num) {
class MyTask (line 70) | static class MyTask implements Callable<List<Integer>> {
method MyTask (line 73) | public MyTask(int startPos, int endPos) {
method call (line 78) | @Override
FILE: src/main/java/com/mark/concurrent26/T08_CachedThreadPool.java
class T08_CachedThreadPool (line 12) | public class T08_CachedThreadPool {
method main (line 13) | public static void main(String[] args) throws InterruptedException {
FILE: src/main/java/com/mark/concurrent26/T09_SingleThreadPool.java
class T09_SingleThreadPool (line 11) | public class T09_SingleThreadPool {
method main (line 13) | public static void main(String[] args) throws InterruptedException {
FILE: src/main/java/com/mark/concurrent26/T10_ScheduleThreadPool.java
class T10_ScheduleThreadPool (line 12) | public class T10_ScheduleThreadPool {
method main (line 13) | public static void main(String[] args) throws InterruptedException {
FILE: src/main/java/com/mark/concurrent26/T11_WorkStealingPool.java
class T11_WorkStealingPool (line 12) | public class T11_WorkStealingPool {
method main (line 13) | public static void main(String[] args) throws InterruptedException, IO...
class R (line 33) | static class R implements Runnable {
method R (line 37) | public R(int time) {
method run (line 41) | @Override
FILE: src/main/java/com/mark/concurrent26/T12_ForkJoinPool.java
class T12_ForkJoinPool (line 18) | public class T12_ForkJoinPool {
class AddTask (line 30) | static class AddTask extends RecursiveAction {
method AddTask (line 34) | public AddTask(int start, int end) {
method compute (line 39) | @Override
method main (line 88) | public static void main(String[] args) throws InterruptedException, IO...
FILE: src/main/java/com/mark/concurrent26/T13_ThreadPoolExecutor.java
class T13_ThreadPoolExecutor (line 11) | public class T13_ThreadPoolExecutor {
method main (line 12) | public static void main(String[] args) throws InterruptedException, IO...
FILE: src/main/java/com/mark/concurrent26/T14_ParallelStreamAPI.java
class T14_ParallelStreamAPI (line 12) | public class T14_ParallelStreamAPI {
method main (line 13) | public static void main(String[] args) throws InterruptedException, IO...
method isPrime (line 31) | static boolean isPrime(int num) {
FILE: src/main/java/com/mark/concurrent26/T15_SelfDefinitionThreadPool.java
class T15_SelfDefinitionThreadPool (line 16) | public class T15_SelfDefinitionThreadPool {
method main (line 18) | public static void main(String[] args) {
method sum (line 46) | static int sum(int start, int end) {
FILE: src/main/java/com/mmap/MemoryBufferTest.java
class MemoryBufferTest (line 15) | public class MemoryBufferTest {
method main (line 18) | public static void main(String[] args) throws Exception {
method normalMemoryBuffer (line 23) | private static void normalMemoryBuffer() throws IOException {
method mappedBuffer (line 40) | private static void mappedBuffer() throws Exception {
FILE: src/main/java/com/mmap/MmapWriteReadTest.java
class MmapWriteReadTest (line 14) | public class MmapWriteReadTest {
method main (line 21) | public static void main(String[] args) throws Exception {
method write (line 26) | private static void write() throws IOException {
method read (line 37) | private static void read() throws Exception {
method writeIntoMemoryMappedFile (line 56) | private static void writeIntoMemoryMappedFile() throws Exception {
FILE: src/main/java/com/program/CodeGenerator.java
class CodeGenerator (line 8) | public class CodeGenerator {
method generateCode (line 11) | public static String generateCode(int codeLength) {
method convert (line 30) | public static String convert(int digits, int val) {
method main (line 36) | public static void main(String[] args) {
FILE: src/main/java/com/program/CollectionIterate.java
class CollectionIterate (line 14) | public class CollectionIterate {
method main (line 16) | public static void main(String[] args) {
FILE: src/main/java/com/program/ConstructTree.java
class ConstructTree (line 16) | public class ConstructTree {
class Menu (line 18) | static class Menu {
method Menu (line 25) | public Menu(int id, String name, int pId) {
method getId (line 31) | public int getId() {
method setId (line 35) | public void setId(int id) {
method getName (line 39) | public String getName() {
method setName (line 43) | public void setName(String name) {
method getpId (line 47) | public int getpId() {
method setpId (line 51) | public void setpId(int pId) {
method getMenu (line 55) | public List<Menu> getMenu() {
method setMenu (line 59) | public void setMenu(List<Menu> menu) {
method toString (line 63) | @Override
method main (line 69) | public static void main(String[] args) {
method getChildrens (line 98) | private static List<Menu> getChildrens(Menu root, List<Menu> all) {
FILE: src/main/java/com/program/FizzBuzzDemo.java
class FizzBuzzDemo (line 6) | public class FizzBuzzDemo {
method main (line 7) | public static void main(String[] args) {
FILE: src/main/java/com/program/ULIDTest.java
class ULIDTest (line 10) | public class ULIDTest {
method main (line 12) | public static void main(String[] args) {
FILE: src/main/java/com/program/WechatCircleLikeDisplay.java
class WechatCircleLikeDisplay (line 12) | public class WechatCircleLikeDisplay {
method main (line 16) | public static void main(String[] args) {
method getWechatLikeStr (line 26) | private static String getWechatLikeStr(List<String> names) {
FILE: src/main/java/com/snake/Direction.java
type Direction (line 6) | public enum Direction {
FILE: src/main/java/com/snake/Egg.java
class Egg (line 9) | public class Egg {
method Egg (line 14) | public Egg(int row, int col) {
method paint (line 19) | public void paint(Graphics g) {
method reAppear (line 31) | public void reAppear() {
FILE: src/main/java/com/snake/Node.java
class Node (line 8) | public class Node {
method Node (line 12) | public Node(int row, int col) {
method paint (line 17) | public void paint(Graphics g) {
FILE: src/main/java/com/snake/Snake.java
class Snake (line 6) | public class Snake {
method Snake (line 10) | public Snake() {
method paint (line 20) | public void paint(Graphics g) {
method move (line 30) | private void move() {
method boundaryCheck (line 36) | private void boundaryCheck() {
method addToHead (line 43) | private void addToHead() {
method deleteTail (line 66) | private void deleteTail() {
method keyPressed (line 78) | public void keyPressed(KeyEvent e) {
method eat (line 96) | public void eat(Egg e) {
FILE: src/main/java/com/snake/Yard.java
class Yard (line 9) | public class Yard extends Frame {
method Yard (line 22) | public Yard() {
method paint (line 55) | @Override
method update (line 78) | @Override
method main (line 88) | public static void main(String[] args) {
FILE: src/main/java/com/thread/AnimalBehavior.java
type AnimalBehavior (line 6) | public interface AnimalBehavior {
method eat (line 7) | default void eat() {
FILE: src/main/java/com/thread/Cat.java
class Cat (line 6) | public class Cat implements AnimalBehavior {
method eat (line 8) | @Override
FILE: src/main/java/com/thread/CatMain.java
class CatMain (line 6) | public class CatMain {
method main (line 7) | public static void main(String[] args) {
FILE: src/main/java/com/thread/MyRunnable.java
class MyRunnable (line 8) | public class MyRunnable implements Runnable {
method run (line 10) | @Override
FILE: src/main/java/com/thread/MyRunnableTest.java
class MyRunnableTest (line 6) | public class MyRunnableTest {
method main (line 7) | public static void main(String[] args) {
FILE: src/main/java/com/thread/NotifySpecifiedThread.java
class NotifySpecifiedThread (line 11) | public class NotifySpecifiedThread {
method main (line 12) | public static void main(String[] args) throws Exception {
FILE: src/main/java/com/thread/T.java
class T (line 3) | public class T {
method main (line 4) | public static void main(String[] args) {
FILE: src/main/java/com/thread/T01_TestJoin.java
class T01_TestJoin (line 5) | public class T01_TestJoin {
method main (line 6) | public static void main(String[] args) {
class MyThread (line 22) | class MyThread implements Runnable {
method run (line 23) | @Override
FILE: src/test/java/com/java8/NewFeatureTest.java
class NewFeatureTest (line 14) | public class NewFeatureTest extends TestCase {
method testLambda01 (line 16) | @Test
method testLambda02 (line 29) | @Test
method testLambda03 (line 40) | @Test
method testLambda04 (line 57) | @Test
method display (line 71) | public void display(String s, MyFunctionalInterface myFunctionalInterf...
type MyFunctionalInterface (line 75) | interface MyFunctionalInterface {
method reverse (line 76) | String reverse(String s);
type MyVal (line 79) | interface MyVal {
method getVal (line 80) | double getVal();
type ValidEvenNum (line 83) | interface ValidEvenNum {
method isEven (line 84) | boolean isEven(int num);
method testLambda05 (line 89) | @Test
method testLambda06 (line 114) | @Test
FILE: src/test/java/com/mark/concurrent01/TTest.java
class TTest (line 13) | public class TTest extends TestCase {
method setUp (line 15) | @Before
method tearDown (line 18) | @After
method testM (line 21) | @Test
method testDate (line 28) | @Test
Condensed preview — 335 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (547K chars).
[
{
"path": ".editorconfig",
"chars": 229,
"preview": "root = true\n\n[*.{groovy, java, kt, xml}]\n#缩进风格:空格\nindent_style = space\n#缩进大小\nindent_size = 4\n#换行符lf\nend_of_line = lf\n#字符"
},
{
"path": ".gitignore",
"chars": 443,
"preview": "# Compiled class file\n*.class\n\n# Log file\n*.log\n\n# BlueJ files\n*.ctxt\n\n# Mobile Tools for Java (J2ME)\n.mtj.tmp/\n\n# Packa"
},
{
"path": ".mvn/jvm.config",
"chars": 9,
"preview": "-Xmx1536m"
},
{
"path": ".mvn/wrapper/maven-wrapper.properties",
"chars": 217,
"preview": "distributionUrl=https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.zip\nwrap"
},
{
"path": ".travis.yml",
"chars": 157,
"preview": "language: java\njdk: openjdk8\ncache:\n directories:\n - $HOME/.m2\nbefore_install:\n - chmod +x mvnw\ninstall:\n - ./mvnw"
},
{
"path": "README.md",
"chars": 6262,
"preview": "### 小统计:\n\n\n\n> **Don't count the"
},
{
"path": "concurrency.md",
"chars": 1118,
"preview": "# 马士兵高并发编程视频教程源码。\n\n### 线程池类图\n\n SE Runtime Environment (build 1.8.0_112-b15)\nJava "
},
{
"path": "mvnw",
"chars": 9893,
"preview": "#!/bin/sh\n# ----------------------------------------------------------------------------\n# Licensed to the Apache Softwa"
},
{
"path": "mvnw.cmd",
"chars": 6302,
"preview": "@REM ----------------------------------------------------------------------------\n@REM Licensed to the Apache Software F"
},
{
"path": "pom.xml",
"chars": 1981,
"preview": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:sch"
},
{
"path": "src/main/java/com/annotation/README.md",
"chars": 2973,
"preview": "# 按运行机制分类\n- 源码注解:注解只在源码中存在,编译成.class文件就不存在了\n- 编译时注解:在源码和.class文件中都会存在注解\n- 运行时注解:在运行阶段还起作用,甚至韵影像运行逻辑的注解\n\n# 按来源分类\n- JDK 中自"
},
{
"path": "src/main/java/com/annotation/jdk/Child.java",
"chars": 871,
"preview": "package com.annotation.jdk;\n\nimport com.annotation.own.Description;\n\n/**\n * @Override 这个注解 告诉编译器 / 程序员,方法覆盖接口中方法\n * Indi"
},
{
"path": "src/main/java/com/annotation/jdk/ParseAnnotation.java",
"chars": 1530,
"preview": "package com.annotation.jdk;\n\nimport com.annotation.own.Description;\n\nimport java.lang.annotation.Annotation;\nimport java"
},
{
"path": "src/main/java/com/annotation/jdk/Person.java",
"chars": 471,
"preview": "package com.annotation.jdk;\n\n/**\n * Java 注解从 Java 5开始\n * @Deprecated 已过时;被废弃\n * A program element annotated @Deprecated "
},
{
"path": "src/main/java/com/annotation/jdk/Test.java",
"chars": 933,
"preview": "package com.annotation.jdk;\n\n/**\n * @SuppressWarnings suppress v. 抑制,压制,阻止\n * Indicates that the named compiler warnings"
},
{
"path": "src/main/java/com/annotation/own/Description.java",
"chars": 234,
"preview": "package com.annotation.own;\n\nimport java.lang.annotation.*;\n\n@Target({ElementType.METHOD, ElementType.TYPE})\n@Retention("
},
{
"path": "src/main/java/com/annotation/project/Column.java",
"chars": 307,
"preview": "package com.annotation.project;\n\nimport java.lang.annotation.ElementType;\nimport java.lang.annotation.Retention;\nimport "
},
{
"path": "src/main/java/com/annotation/project/Department.java",
"chars": 781,
"preview": "package com.annotation.project;\n\n@Table(\"t_department\")\npublic class Department {\n @Column(\"id\")\n private int id;\n"
},
{
"path": "src/main/java/com/annotation/project/Table.java",
"chars": 305,
"preview": "package com.annotation.project;\n\nimport java.lang.annotation.ElementType;\nimport java.lang.annotation.Retention;\nimport "
},
{
"path": "src/main/java/com/annotation/project/Test.java",
"chars": 3475,
"preview": "package com.annotation.project;\n\nimport java.lang.reflect.Field;\nimport java.lang.reflect.Method;\n\npublic class Test {\n "
},
{
"path": "src/main/java/com/annotation/project/User.java",
"chars": 1346,
"preview": "package com.annotation.project;\n\n@Table(\"t_user\")\npublic class User {\n\n @Column(\"id\")\n private int id;\n @Column"
},
{
"path": "src/main/java/com/art/concurrency/ch01/ConcurrencyTest.java",
"chars": 1421,
"preview": "package com.art.concurrency.ch01;\n\n/**\n * 1. 循环次数\n * 2. 串并行程序实行时间\n * 3. Lmbench3 http://www.bitmover.com/lmbench/ 上下文切换的"
},
{
"path": "src/main/java/com/art/concurrency/ch01/DeadLockDemo.java",
"chars": 1270,
"preview": "package com.art.concurrency.ch01;\n\npublic class DeadLockDemo {\n private static String A = \"A\";\n private static Str"
},
{
"path": "src/main/java/com/art/concurrency/ch04/Daemon.java",
"chars": 443,
"preview": "package com.art.concurrency.ch04;\n\nimport com.art.concurrency.utils.SleepUtils;\n\npublic class Daemon {\n public static"
},
{
"path": "src/main/java/com/art/concurrency/ch04/Deprecated.java",
"chars": 1397,
"preview": "package com.art.concurrency.ch04;\n\nimport com.art.concurrency.utils.SleepUtils;\n\nimport java.text.DateFormat;\nimport jav"
},
{
"path": "src/main/java/com/art/concurrency/ch04/Interrupted.java",
"chars": 1165,
"preview": "package com.art.concurrency.ch04;\n\nimport com.art.concurrency.utils.SleepUtils;\n\nimport java.util.concurrent.TimeUnit;\n\n"
},
{
"path": "src/main/java/com/art/concurrency/ch04/MultiThread.java",
"chars": 557,
"preview": "package com.art.concurrency.ch04;\n\nimport java.lang.management.ManagementFactory;\nimport java.lang.management.ThreadInfo"
},
{
"path": "src/main/java/com/art/concurrency/ch04/Priority.java",
"chars": 1519,
"preview": "package com.art.concurrency.ch04;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.concurrent.TimeUn"
},
{
"path": "src/main/java/com/art/concurrency/ch04/Shutdown.java",
"chars": 954,
"preview": "package com.art.concurrency.ch04;\n\nimport java.util.concurrent.TimeUnit;\n\npublic class Shutdown {\n public static void"
},
{
"path": "src/main/java/com/art/concurrency/ch04/ThreadState.java",
"chars": 1393,
"preview": "package com.art.concurrency.ch04;\n\nimport com.art.concurrency.utils.SleepUtils;\n\n/**\n * https://docs.oracle.com/javase/8"
},
{
"path": "src/main/java/com/art/concurrency/ch08/BankWaterService.java",
"chars": 1690,
"preview": "package com.art.concurrency.ch08;\n\nimport java.util.Map;\nimport java.util.concurrent.*;\n\npublic class BankWaterService i"
},
{
"path": "src/main/java/com/art/concurrency/ch08/CountDownLatchTest.java",
"chars": 777,
"preview": "package com.art.concurrency.ch08;\n\nimport java.util.concurrent.CountDownLatch;\n\npublic class CountDownLatchTest {\n //"
},
{
"path": "src/main/java/com/art/concurrency/ch08/CyclicBarrierTest.java",
"chars": 877,
"preview": "package com.art.concurrency.ch08;\n\nimport java.util.concurrent.BrokenBarrierException;\nimport java.util.concurrent.Cycli"
},
{
"path": "src/main/java/com/art/concurrency/ch08/CyclicBarrierTest02.java",
"chars": 983,
"preview": "package com.art.concurrency.ch08;\n\nimport java.util.concurrent.BrokenBarrierException;\nimport java.util.concurrent.Cycli"
},
{
"path": "src/main/java/com/art/concurrency/ch08/CyclicBarrierTest03.java",
"chars": 870,
"preview": "package com.art.concurrency.ch08;\n\nimport java.util.concurrent.BrokenBarrierException;\nimport java.util.concurrent.Cycli"
},
{
"path": "src/main/java/com/art/concurrency/ch08/ExchangerTest.java",
"chars": 1440,
"preview": "package com.art.concurrency.ch08;\n\nimport java.util.concurrent.Exchanger;\nimport java.util.concurrent.ExecutorService;\ni"
},
{
"path": "src/main/java/com/art/concurrency/ch08/SemaphoreTest.java",
"chars": 1161,
"preview": "package com.art.concurrency.ch08;\n\nimport java.util.concurrent.ExecutorService;\nimport java.util.concurrent.Executors;\ni"
},
{
"path": "src/main/java/com/art/concurrency/utils/SleepUtils.java",
"chars": 306,
"preview": "package com.art.concurrency.utils;\n\nimport java.util.concurrent.TimeUnit;\n\npublic class SleepUtils {\n public static f"
},
{
"path": "src/main/java/com/basic/alibaba/BigDecimalTest.java",
"chars": 381,
"preview": "package com.basic.alibaba;\n\nimport java.math.BigDecimal;\n\n/**\n * @description alibaba\n * @author shenjy\n * @since 2019/0"
},
{
"path": "src/main/java/com/basic/alibaba/CollectionTest.java",
"chars": 2610,
"preview": "package com.basic.alibaba;\n\n/**\n * 集合处理\n *\n * @author MarkShen1992\n * @since 20200509\n */\npublic class CollectionTest {\n"
},
{
"path": "src/main/java/com/basic/alibaba/ConfusingName.java",
"chars": 512,
"preview": "package com.basic.alibaba;\n\n/**\n * @author MarkShen1992\n * @since 2020.4.29\n */\npublic class ConfusingName {\n public "
},
{
"path": "src/main/java/com/basic/alibaba/DateTest.java",
"chars": 1234,
"preview": "package com.basic.alibaba;\n\nimport java.text.DateFormat;\nimport java.text.SimpleDateFormat;\nimport java.time.LocalDate;\n"
},
{
"path": "src/main/java/com/basic/alibaba/FloatPrimitiveTest.java",
"chars": 378,
"preview": "package com.basic.alibaba;\n\n/**\n * @description alibaba\n * @author shenjy\n * @since 2019/08/04\n */\npublic class FloatPri"
},
{
"path": "src/main/java/com/basic/alibaba/FloatWrapTest.java",
"chars": 403,
"preview": "package com.basic.alibaba;\n\n/**\n * @description alibaba\n * @author shenjy\n * @since 2019/08/04\n */\npublic class FloatWra"
},
{
"path": "src/main/java/com/basic/alibaba/IntegerCacheTest.java",
"chars": 693,
"preview": "package com.basic.alibaba;\n\n/**\n * IntegerCacheTest\n *\n * @author MarkShen1992\n * @since 2020.5.1\n */\npublic class Integ"
},
{
"path": "src/main/java/com/basic/alibaba/LockTest.java",
"chars": 489,
"preview": "package com.basic.alibaba;\n\nimport java.util.concurrent.locks.Lock;\nimport java.util.concurrent.locks.ReentrantLock;\n\n/*"
},
{
"path": "src/main/java/com/basic/alibaba/PrimitiveTypeArrayMaxSizeTest.java",
"chars": 1436,
"preview": "package com.basic.alibaba;\n\n/**\n * C:\\Users\\shenjy>java -version java version \"1.8.0_112\" Java(TM) SE Runtime Environmen"
},
{
"path": "src/main/java/com/basic/alibaba/SwitchTest.java",
"chars": 402,
"preview": "package com.basic.alibaba;\n\n/**\n * @description alibaba\n * @author shenjy\n * @since 2019/08/04\n */\npublic class SwitchTe"
},
{
"path": "src/main/java/com/basic/alibaba/package-info.java",
"chars": 458,
"preview": "package com.basic.alibaba;\n\n/**\n * @link https://developer.aliyun.com/special/tech-java\n * 优雅性,可扩展性,可读性\n * 分布式事务,分布式消息队列"
},
{
"path": "src/main/java/com/basic/chapter0100/Chapter0100Introduction.java",
"chars": 3183,
"preview": "package com.basic.chapter0100;\n\n/**\n * 简介\n * 读书怎么读:看一个大概,直接用,用的时候回来再查\n * JDK安装后,看下JDK安装目录\n * @author MarkShen1992\n * @si"
},
{
"path": "src/main/java/com/basic/chapter0100/Chapter0101Identifier.java",
"chars": 479,
"preview": "package com.basic.chapter0100;\n\n/**\n * 标识符\n * @author MarkShen1992\n * @since 20191101\n */\npublic class Chapter0101Identi"
},
{
"path": "src/main/java/com/basic/chapter0100/Chapter0102JavaKeyWord.java",
"chars": 354,
"preview": "package com.basic.chapter0100;\n\n/**\n * 关键字\n * @author MarkShen1992\n * @since 20191101\n */\npublic class Chapter0102JavaKe"
},
{
"path": "src/main/java/com/basic/chapter0100/Chapter0103ConstantAndVariable.java",
"chars": 1082,
"preview": "package com.basic.chapter0100;\n\n/**\n * 常量与变量\n * @author MarkShen1992\n * @since 20191101\n */\npublic class Chapter0103Cons"
},
{
"path": "src/main/java/com/basic/chapter0100/Chapter0104TestVar.java",
"chars": 522,
"preview": "package com.basic.chapter0100;\n\n/**\n * 敲程序方法:在看懂整个程序的意思后,背着把程序敲出来;\n * 或者有自己的理解后,自己组织程序结构完成程序。\n * @author MarkShen1992\n *"
},
{
"path": "src/main/java/com/basic/chapter0100/Chapter0104TestVar2.java",
"chars": 539,
"preview": "package com.basic.chapter0100;\n\n/**\n * 数据类型测试\n * @author MarkShen1992\n * @since 20191102\n */\npublic class Chapter0104Tes"
},
{
"path": "src/main/java/com/basic/chapter0100/Chapter0104VariableType.java",
"chars": 615,
"preview": "package com.basic.chapter0100;\n\n/**\n * 变量分类\n * @author MarkShen1992\n * @since 20191101\n */\npublic class Chapter0104Varia"
},
{
"path": "src/main/java/com/basic/chapter0100/Chapter0105DataType.java",
"chars": 2116,
"preview": "package com.basic.chapter0100;\n\n/**\n * 数据类型\n * @author MarkShen1992\n * @since 20191102\n */\npublic class Chapter0105DataT"
},
{
"path": "src/main/java/com/basic/chapter0100/Chapter0106BasicDataTypeConvertPrinciple.java",
"chars": 659,
"preview": "package com.basic.chapter0100;\n\n/**\n * 基本数据类型转换\n * @author MarkShen1992\n * @since 20191102\n */\npublic class Chapter0106B"
},
{
"path": "src/main/java/com/basic/chapter0100/Chapter0106TestConvert.java",
"chars": 779,
"preview": "package com.basic.chapter0100;\n\n/**\n * 练习程序\n * @author MarkShen1992\n * @since 20191102\n */\npublic class Chapter0106TestC"
},
{
"path": "src/main/java/com/basic/chapter0100/Chapter0106TestConvert2.java",
"chars": 679,
"preview": "package com.basic.chapter0100;\n\npublic class Chapter0106TestConvert2 {\n public static void main(String[] args) {\n "
},
{
"path": "src/main/java/com/basic/chapter0100/Chapter0107TestIF.java",
"chars": 577,
"preview": "package com.basic.chapter0100;\n\n/**\n * if 表达式\n * @author MarkShen1992\n * @since 20191103\n */\npublic class Chapter0107Tes"
},
{
"path": "src/main/java/com/basic/chapter0100/Chapter0108For.java",
"chars": 1603,
"preview": "package com.basic.chapter0100;\n\n/**\n * for语句, 计算1到 100这100个数之和\n * foreach语句打印\n * 分析算法时候,分析内存,找到规律。分析别人的算法,多分析别人的程序\n * 多读"
},
{
"path": "src/main/java/com/basic/chapter0100/Chapter0109TestWhile.java",
"chars": 410,
"preview": "package com.basic.chapter0100;\n\n/**\n * while\n * do...while\n *\n * @author MarkShen1992\n * @since 20191103\n */\npublic clas"
},
{
"path": "src/main/java/com/basic/chapter0100/Chapter0110TestBreakAndContinue.java",
"chars": 579,
"preview": "package com.basic.chapter0100;\n\n/**\n * break\n * continue\n *\n * @author MarkShen1992\n * @since 20191103\n */\npublic class "
},
{
"path": "src/main/java/com/basic/chapter0100/Chapter0111TestSwitch.java",
"chars": 687,
"preview": "package com.basic.chapter0100;\n\n/**\n * switch\n * @author MarkShen1992\n * @since 20191103\n */\npublic class Chapter0111Tes"
},
{
"path": "src/main/java/com/basic/chapter0100/Chapter0112TestMethod.java",
"chars": 714,
"preview": "package com.basic.chapter0100;\n\n/**\n * 方法: 增强程序的复用性\n *\n * @author MarkShen1992\n * @since 20191103\n */\npublic class Chapt"
},
{
"path": "src/main/java/com/basic/chapter0100/Chapter0113TestMethod2.java",
"chars": 539,
"preview": "package com.basic.chapter0100;\n\n/**\n * method\n * @author MarkShen1992\n * @since 20191103\n */\npublic class Chapter0113Tes"
},
{
"path": "src/main/java/com/basic/chapter0100/Chapter0114Fab.java",
"chars": 585,
"preview": "package com.basic.chapter0100;\n\npublic class Chapter0114Fab {\n public static void main(String[] args) {\n Syste"
},
{
"path": "src/main/java/com/basic/chapter0100/Test01.java",
"chars": 593,
"preview": "package com.basic.chapter0100;\n\n/**\n * PPT中未敲完的程序\n *\n * @author MarkShen\n * @since 20191207\n */\npublic class Test01 {\n "
},
{
"path": "src/main/java/com/basic/chapter0100/Test02.java",
"chars": 1042,
"preview": "package com.basic.chapter0100;\n\n/**\n * PPT中未敲完的程序\n *\n * @author MarkShen\n * @since 20191207\n */\npublic class Test02 {\n "
},
{
"path": "src/main/java/com/basic/chapter0200/Chapter0200Introduction.java",
"chars": 6434,
"preview": "package com.basic.chapter0200;\n\n/**\n * 简介\n * 指导性思想(极其重要)\n * 第一步:考虑问题域中有哪些类,哪些对象\n * 第二步:这些个类,这些个对象有哪些个属性\n * 第三步:考虑类与类之间的关"
},
{
"path": "src/main/java/com/basic/chapter0200/Chapter0201OO.java",
"chars": 662,
"preview": "package com.basic.chapter0200;\n\n/**\n *\n * @author MarkShen1992\n * @since 20191105\n */\npublic class Chapter0201OO {\n p"
},
{
"path": "src/main/java/com/basic/chapter0200/Chapter0202ValueTransferAndReferenceTransfer.java",
"chars": 1754,
"preview": "package com.basic.chapter0200;\n\n/**\n * 小程序分析内存,清楚理解值传递,引用传递\n *\n * 方法执行完毕,为方法分配的局部变量(stack内存)所分配的内存自动消失\n * Heap内存中的内存需要垃圾"
},
{
"path": "src/main/java/com/basic/chapter0200/Chapter0203Point.java",
"chars": 1140,
"preview": "package com.basic.chapter0200;\n\n/**\n * 练习例子\n *\n * @author MarkShen1992\n * @since 20191107\n */\npublic class Chapter0203Po"
},
{
"path": "src/main/java/com/basic/chapter0200/Chapter0204MethodOverload.java",
"chars": 1188,
"preview": "package com.basic.chapter0200;\n\n/**\n * 方法重载:指一个类中可以定义有相同的名字,单参数不同的多个方法,调用时会根据参数的不同\n * 调用不同的方法。\n * 重载方法参数特性:\n * 个数不同\n * "
},
{
"path": "src/main/java/com/basic/chapter0200/Chapter0205TestOverLoad.java",
"chars": 935,
"preview": "package com.basic.chapter0200;\n\n/**\n * 练习例子\n *\n * @author MarkShen1992\n * @since 20191107\n */\npublic class Chapter0205Te"
},
{
"path": "src/main/java/com/basic/chapter0200/Chapter0206TestCircle.java",
"chars": 2237,
"preview": "package com.basic.chapter0200;\n\nclass Point2 {\n private double x;\n private double y;\n\n Point2(double x1, double"
},
{
"path": "src/main/java/com/basic/chapter0200/Chapter0207this.java",
"chars": 749,
"preview": "package com.basic.chapter0200;\n\n/**\n * this 关键字\n * 在类的方法定义中使用的this关键字代表使用该方法的对象的引用\n * 当必须指定当前使用方法的对象是谁的时候用this\n * 使用this"
},
{
"path": "src/main/java/com/basic/chapter0200/Chapter0208static.java",
"chars": 630,
"preview": "package com.basic.chapter0200;\n\n/**\n * static 关键字\n * static 修饰的成员变量为静态成员变量,它为该类的共有变量,在第一次使用时被初始化,对该类的所有\n * 对象来说,static 成"
},
{
"path": "src/main/java/com/basic/chapter0200/Chapter0209TestInherit.java",
"chars": 667,
"preview": "package com.basic.chapter0200;\n\nclass FatherClass {\n public int value;\n\n public void f() {\n value = 100;\n "
},
{
"path": "src/main/java/com/basic/chapter0200/Chapter0210TestEquals.java",
"chars": 1129,
"preview": "package com.basic.chapter0200;\n\nimport java.util.Objects;\n\npublic class Chapter0210TestEquals {\n public static void m"
},
{
"path": "src/main/java/com/basic/chapter0200/Chapter0211TestFinal.java",
"chars": 286,
"preview": "package com.basic.chapter0200;\n\npublic class Chapter0211TestFinal {\n\tpublic static void main(String[] args) {\n\t\tT t = ne"
},
{
"path": "src/main/java/com/basic/chapter0200/Chapter0212TestInterface.java",
"chars": 988,
"preview": "package com.basic.chapter0200;\n\n/**\n * 接口测试\n *\n * @author MarkShen1992\n * @since 20191120\n */\npublic class Chapter0212Te"
},
{
"path": "src/main/java/com/basic/chapter0200/Chapter0213DoubleBraceInitializationModel.java",
"chars": 1335,
"preview": "package com.basic.chapter0200;\n\nimport java.util.UUID;\n\npublic class Chapter0213DoubleBraceInitializationModel {\n pub"
},
{
"path": "src/main/java/com/basic/chapter0200/MessageFormatTest.java",
"chars": 444,
"preview": "package com.basic.chapter0200;\n\nimport java.text.MessageFormat;\nimport java.util.Date;\n\npublic class MessageFormatTest {"
},
{
"path": "src/main/java/com/basic/chapter0200/TestSuperSub.java",
"chars": 828,
"preview": "package com.basic.chapter0200;\n\nclass SuperClass {\n private int n;\n\n SuperClass() {\n System.out.println(\"Su"
},
{
"path": "src/main/java/com/basic/chapter0300/Chapter0300ExceptionIntroduction.java",
"chars": 1283,
"preview": "package com.basic.chapter0300;\n\n/**\n * Exception\n * 异常的概念\n * Java异常的分类\n * 异常的捕获和处理\n * 运行期出现的问题\n *\n *"
},
{
"path": "src/main/java/com/basic/chapter0300/Chapter0301TestEx.java",
"chars": 1864,
"preview": "package com.basic.chapter0300;\n\nimport java.io.*;\n\n/**\n * 异常处理\n *\n * @author MarkShen\n * @since 20191121\n */\npublic clas"
},
{
"path": "src/main/java/com/basic/chapter0300/Chapter0302MethodException.java",
"chars": 339,
"preview": "package com.basic.chapter0300;\n\n/**\n * 方法异常\n *\n * @author MarkShen\n * @since 20191121\n */\npublic class Chapter0302Method"
},
{
"path": "src/main/java/com/basic/chapter0300/Chapter0303Junk.java",
"chars": 1409,
"preview": "package com.basic.chapter0300;\n\n/**\n * Method Exception handle\n * 能处理的一定要处理,处理不了的往外抛\n * 多读设计精巧的源码,体会设计思想尤为重要\n *\n * 异常和继承"
},
{
"path": "src/main/java/com/basic/chapter0400/Chapter0401ArrayIntroduction.java",
"chars": 1359,
"preview": "package com.basic.chapter0400;\n\n/**\n * 数组[空间]介绍\n * 一维数组声明方式\n * type var[] 或者 type[] var\n * Java语言声明数组时不能指定其长度。\n * int[5]"
},
{
"path": "src/main/java/com/basic/chapter0400/Chapter0402TestArgs.java",
"chars": 924,
"preview": "package com.basic.chapter0400;\n\npublic class Chapter0402TestArgs {\n public static void main(String[] args) {\n\t\t/*\n\t\tf"
},
{
"path": "src/main/java/com/basic/chapter0400/Chapter0403SortAlgorithm.java",
"chars": 2160,
"preview": "package com.basic.chapter0400;\n\n/**\n * 排序数组: 选择排序(Selection Sort)\n * 写程序先跑主流程,主流程跑通后再考虑程序的细节\n *\n * 如何分析一个你不熟悉的算法呢?\n * 在纸"
},
{
"path": "src/main/java/com/basic/chapter0400/Chapter0404TestDateSort.java",
"chars": 2178,
"preview": "package com.basic.chapter0400;\n\n/**\n * 对对象进行排序\n *\n * @author MarkShen\n * @since 20191124\n */\npublic class Chapter0404Tes"
},
{
"path": "src/main/java/com/basic/chapter0400/Chapter0405TestSearch.java",
"chars": 1042,
"preview": "package com.basic.chapter0400;\n\n/**\n * 搜索算法建立在排序算法的基础之上\n * 二分法查找算法\n *\n * @author MarkShen\n * @since 20191124\n */\npublic "
},
{
"path": "src/main/java/com/basic/chapter0400/Chapter0406TestArrayCopy.java",
"chars": 886,
"preview": "package com.basic.chapter0400;\n\npublic class Chapter0406TestArrayCopy {\n public static void main(String args[]) {\n "
},
{
"path": "src/main/java/com/basic/chapter0400/Count3Quit.java",
"chars": 913,
"preview": "package com.basic.chapter0400;\n\n/**\n * 数三退一\n *\n * @author MarkShen\n * @since 20191124\n */\npublic class Count3Quit {\n "
},
{
"path": "src/main/java/com/basic/chapter0400/Count3Quit2.java",
"chars": 1492,
"preview": "package com.basic.chapter0400;\n\n/**\n * 数三退一\n *\n * @author MarkShen\n * @since 20191124\n */\npublic class Count3Quit2 {\n "
},
{
"path": "src/main/java/com/basic/chapter0500/Chapter0501CommonUseClass.java",
"chars": 651,
"preview": "package com.basic.chapter0500;\n\n/**\n * 常用类介绍\n * 字符串\n * 基本类型包装类\n * Math类\n * File类\n * 枚举类\n */\npublic class Chapter0501Comm"
},
{
"path": "src/main/java/com/basic/chapter0500/Chapter0502TestString2.java",
"chars": 596,
"preview": "package com.basic.chapter0500;\n\n/**\n * String\n *\n * @author MarkShen\n * @since 20191127\n */\npublic class Chapter0502Test"
},
{
"path": "src/main/java/com/basic/chapter0500/Chapter0503TestString3.java",
"chars": 3350,
"preview": "package com.basic.chapter0500;\n\nimport java.util.Date;\n\n/**\n * String\n *\n * @author MarkShen\n * @since 20191127\n */\npubl"
},
{
"path": "src/main/java/com/basic/chapter0500/Chapter0504TestString.java",
"chars": 1289,
"preview": "package com.basic.chapter0500;\n\nimport java.util.regex.*;\npublic class Chapter0504TestString {\n\tpublic static void main("
},
{
"path": "src/main/java/com/basic/chapter0500/Chapter0505StringBuffer.java",
"chars": 487,
"preview": "package com.basic.chapter0500;\n\n/**\n * StringBuffer\n *\n * @author MarkShen\n * @since 20191129\n */\npublic class Chapter05"
},
{
"path": "src/main/java/com/basic/chapter0500/Chapter0506BasicTypeWrap.java",
"chars": 617,
"preview": "package com.basic.chapter0500;\n\n/**\n * StringBuffer\n *\n * @author MarkShen\n * @since 20191129\n */\npublic class Chapter05"
},
{
"path": "src/main/java/com/basic/chapter0500/Chapter0507ArrayParser.java",
"chars": 815,
"preview": "package com.basic.chapter0500;\n\n/**\n * 解题程序\n *\n * @author MarkShen\n * @since 20191129\n */\npublic class Chapter0507ArrayP"
},
{
"path": "src/main/java/com/basic/chapter0500/Chapter0508TestMath.java",
"chars": 385,
"preview": "package com.basic.chapter0500;\n\n/**\n * Math 测试类\n * 图形学,游戏中可以使用Math类中的方法\n *\n * @MarkShen\n * @since 20191129\n */\npublic cl"
},
{
"path": "src/main/java/com/basic/chapter0500/Chapter0509TestFile.java",
"chars": 913,
"preview": "package com.basic.chapter0500;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * File 测试\n *\n * @author MarkShen\n"
},
{
"path": "src/main/java/com/basic/chapter0500/Chapter0510FileList.java",
"chars": 693,
"preview": "package com.basic.chapter0500;\n\nimport java.io.*;\n\n/**\n * windows 下 tree命令\n */\npublic class Chapter0510FileList {\n pu"
},
{
"path": "src/main/java/com/basic/chapter0500/Chapter0511TestEnum.java",
"chars": 609,
"preview": "package com.basic.chapter0500;\n\n/**\n * 只能取特定值中的一个\n * 使用 enum 关键字\n * 是java.lang.Enum类型\n *\n * @author MarkShen\n * @since 2"
},
{
"path": "src/main/java/com/basic/chapter0600/BasicContainer.java",
"chars": 1829,
"preview": "package com.basic.chapter0600;\n\nimport java.util.*;\n\n/**\n * 三流的公司卖产品\n * 二流的公司卖服务\n * 一流的公司卖标准\n */\npublic class BasicConta"
},
{
"path": "src/main/java/com/basic/chapter0600/BasicGeneric.java",
"chars": 1457,
"preview": "package com.basic.chapter0600;\n\nimport java.util.*;\n\n/**\n * Java 泛型底层:\n * https://www.cnblogs.com/liang1101/p/6407871.ht"
},
{
"path": "src/main/java/com/basic/chapter0600/CollectionsTest.java",
"chars": 706,
"preview": "package com.basic.chapter0600;\n\nimport java.util.Collections;\nimport java.util.LinkedList;\nimport java.util.List;\n\n/**\n "
},
{
"path": "src/main/java/com/basic/chapter0600/DataStructureSelection.java",
"chars": 231,
"preview": "package com.basic.chapter0600;\n\n/**\n * 数据结构选择\n */\npublic class DataStructureSelection {\n public static void main(Stri"
},
{
"path": "src/main/java/com/basic/chapter0600/EnhancedFor.java",
"chars": 459,
"preview": "package com.basic.chapter0600;\n\nimport java.util.*;\n\npublic class EnhancedFor {\n public static void main(String[] arg"
},
{
"path": "src/main/java/com/basic/chapter0600/IteratorTest.java",
"chars": 749,
"preview": "package com.basic.chapter0600;\n\nimport java.util.ArrayList;\nimport java.util.Iterator;\nimport java.util.List;\n\n/**\n * It"
},
{
"path": "src/main/java/com/basic/chapter0600/SetTest.java",
"chars": 412,
"preview": "package com.basic.chapter0600;\n\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * Set:无序,不可重复\n *\n * @author MarkSh"
},
{
"path": "src/main/java/com/basic/chapter0600/TestArgsWords.java",
"chars": 803,
"preview": "package com.basic.chapter0600;\n\nimport java.util.*;\n\n/**\n * 参数中每个单词出现的次数\n * auto-boxing\n * auto-unboxing\n *\n * @author M"
},
{
"path": "src/main/java/com/basic/chapter0600/TestArgsWords2.java",
"chars": 1162,
"preview": "package com.basic.chapter0600;\n\nimport java.util.*;\n\npublic class TestArgsWords2 {\n private static final int ONE = 1;"
},
{
"path": "src/main/java/com/basic/chapter0600/TestMap.java",
"chars": 1176,
"preview": "package com.basic.chapter0600;\n\nimport java.util.*;\n\n/**\n * key-value\n * Auto boxing unboxing\n * Java 自动打包,解包对性能的影响\n * h"
},
{
"path": "src/main/java/com/basic/chapter0600/TestMap2.java",
"chars": 620,
"preview": "package com.basic.chapter0600;\n\nimport java.util.*;\n\n/**\n * 两个类如果equals,那么他们之间的hashcode必须一样\n * <p>\n * 多读Map接口对应的API, Jav"
},
{
"path": "src/main/java/com/basic/chapter0700/FileCopy.java",
"chars": 742,
"preview": "package com.basic.chapter0700;\n\nimport java.io.*;\n\npublic class FileCopy {\n public static void main(String[] args) {\n"
},
{
"path": "src/main/java/com/basic/chapter0700/HelloWorld.java",
"chars": 484,
"preview": "package com.basic.chapter0700;\n\n/**\n * java.io.*;\n * io包裝的类\n * 流的分类:\n * 方向(站在程序的角度):输入流,输出流\n * 处理数据单位:字节(1 byte)流,字符(2 b"
},
{
"path": "src/main/java/com/basic/chapter0700/TestBufferStream1.java",
"chars": 916,
"preview": "package com.basic.chapter0700;\n\nimport java.io.*;\n\npublic class TestBufferStream1 {\n public static void main(String[]"
},
{
"path": "src/main/java/com/basic/chapter0700/TestBufferStream2.java",
"chars": 794,
"preview": "package com.basic.chapter0700;\n\nimport java.io.*;\n\npublic class TestBufferStream2 {\n public static void main(String[]"
},
{
"path": "src/main/java/com/basic/chapter0700/TestDataStream.java",
"chars": 797,
"preview": "package com.basic.chapter0700;\n\nimport java.io.*;\n\npublic class TestDataStream {\n public static void main(String[] ar"
},
{
"path": "src/main/java/com/basic/chapter0700/TestFileInputStream.java",
"chars": 816,
"preview": "package com.basic.chapter0700;\n\nimport java.io.*;\n\npublic class TestFileInputStream {\n public static void main(String"
},
{
"path": "src/main/java/com/basic/chapter0700/TestFileOutputStream.java",
"chars": 791,
"preview": "package com.basic.chapter0700;\n\nimport java.io.*;\n\npublic class TestFileOutputStream {\n public static void main(Strin"
},
{
"path": "src/main/java/com/basic/chapter0700/TestFileReader.java",
"chars": 710,
"preview": "package com.basic.chapter0700;\n\nimport java.io.*;\n\npublic class TestFileReader {\n public static void main(String[] ar"
},
{
"path": "src/main/java/com/basic/chapter0700/TestFileWriter.java",
"chars": 499,
"preview": "package com.basic.chapter0700;\n\nimport java.io.*;\n\npublic class TestFileWriter {\n public static void main(String[] ar"
},
{
"path": "src/main/java/com/basic/chapter0700/TestFileWriter2.java",
"chars": 430,
"preview": "package com.basic.chapter0700;\n\nimport java.io.*;\n\npublic class TestFileWriter2 {\n public static void main(String[] a"
},
{
"path": "src/main/java/com/basic/chapter0700/TestObjectIO.java",
"chars": 808,
"preview": "package com.basic.chapter0700;\n\nimport java.io.*;\n\npublic class TestObjectIO {\n public static void main(String args[]"
},
{
"path": "src/main/java/com/basic/chapter0700/TestPrintStream1.java",
"chars": 661,
"preview": "package com.basic.chapter0700;\n\nimport java.io.*;\n\npublic class TestPrintStream1 {\n public static void main(String[] "
},
{
"path": "src/main/java/com/basic/chapter0700/TestPrintStream2.java",
"chars": 619,
"preview": "package com.basic.chapter0700;\n\nimport java.io.*;\n\npublic class TestPrintStream2 {\n public static void main(String[] "
},
{
"path": "src/main/java/com/basic/chapter0700/TestPrintStream3.java",
"chars": 874,
"preview": "package com.basic.chapter0700;\n\nimport java.util.*;\nimport java.io.*;\n\npublic class TestPrintStream3 {\n public static"
},
{
"path": "src/main/java/com/basic/chapter0700/TestTransForm1.java",
"chars": 693,
"preview": "package com.basic.chapter0700;\n\nimport java.io.*;\n\npublic class TestTransForm1 {\n public static void main(String[] ar"
},
{
"path": "src/main/java/com/basic/chapter0700/TestTransForm2.java",
"chars": 618,
"preview": "package com.basic.chapter0700;\n\nimport java.io.*;\n\npublic class TestTransForm2 {\n public static void main(String args"
},
{
"path": "src/main/java/com/basic/chapter0700/TreeDir.java",
"chars": 497,
"preview": "package com.basic.chapter0700;\n\nimport java.io.*;\n\npublic class TreeDir {\n public static void main(String[] args) {\n "
},
{
"path": "src/main/java/com/basic/chapter0800/111.txt",
"chars": 71,
"preview": "1 2 3 4 5 \n6 7 8 9 10 \n11 12 13 14 15 \n16 17 18 19 20 \n21 22 23 24 25 \n"
},
{
"path": "src/main/java/com/basic/chapter0800/ProducerConsumer.java",
"chars": 1678,
"preview": "package com.basic.chapter0800;\n\npublic class ProducerConsumer {\n\tpublic static void main(String[] args) {\n\t\tSyncStack ss"
},
{
"path": "src/main/java/com/basic/chapter0800/ProducerConsumer2.java",
"chars": 1884,
"preview": "package com.basic.chapter0800;\n\npublic class ProducerConsumer2 {\n public static void main(String args[]) {\n Sy"
},
{
"path": "src/main/java/com/basic/chapter0800/RecursiveFile.java",
"chars": 150,
"preview": "package com.basic.chapter0800;\n\npublic class RecursiveFile {\n public static void main(String[] args) {\n\n }\n\n pu"
},
{
"path": "src/main/java/com/basic/chapter0800/T.java",
"chars": 254,
"preview": "package com.basic.chapter0800;\n\npublic class T {\n public static void main(String[] args) {\n m1();\n }\n\n p"
},
{
"path": "src/main/java/com/basic/chapter0800/TT.java",
"chars": 709,
"preview": "package com.basic.chapter0800;\n\npublic class TT implements Runnable {\n int b = 100;\n\n public synchronized void m1("
},
{
"path": "src/main/java/com/basic/chapter0800/Test.java",
"chars": 407,
"preview": "package com.basic.chapter0800;\n\nimport java.io.*;\n\npublic class Test {\n public static void main(String[] args) throws"
},
{
"path": "src/main/java/com/basic/chapter0800/TestDeadLock.java",
"chars": 873,
"preview": "package com.basic.chapter0800;\n\npublic class TestDeadLock implements Runnable {\n\tpublic int flag = 1;\n\tstatic Object o1 "
},
{
"path": "src/main/java/com/basic/chapter0800/TestInterrupt.java",
"chars": 1058,
"preview": "package com.basic.chapter0800;\n\nimport java.util.*;\n\npublic class TestInterrupt {\n public static void main(String[] a"
},
{
"path": "src/main/java/com/basic/chapter0800/TestJoin.java",
"chars": 721,
"preview": "package com.basic.chapter0800;\n\npublic class TestJoin {\n public static void main(String[] args) {\n MyThread2 t"
},
{
"path": "src/main/java/com/basic/chapter0800/TestPriority.java",
"chars": 610,
"preview": "package com.basic.chapter0800;\n\npublic class TestPriority {\n public static void main(String[] args) {\n Thread "
},
{
"path": "src/main/java/com/basic/chapter0800/TestSync.java",
"chars": 760,
"preview": "package com.basic.chapter0800;\n\npublic class TestSync implements Runnable {\n Timer timer = new Timer();\n\n public s"
},
{
"path": "src/main/java/com/basic/chapter0800/TestThread1.java",
"chars": 552,
"preview": "package com.basic.chapter0800;\n\npublic class TestThread1 {\n public static void main(String args[]) {\n Runner1 "
},
{
"path": "src/main/java/com/basic/chapter0800/TestThread2.java",
"chars": 419,
"preview": "package com.basic.chapter0800;\n\npublic class TestThread2 {\n public static void main(String args[]) {\n Runner2 "
},
{
"path": "src/main/java/com/basic/chapter0800/TestThread3.java",
"chars": 549,
"preview": "package com.basic.chapter0800;\n\npublic class TestThread3 {\n public static void main(String args[]) {\n Runner3 "
},
{
"path": "src/main/java/com/basic/chapter0800/TestThread4.java",
"chars": 708,
"preview": "package com.basic.chapter0800;\n\npublic class TestThread4 {\n public static void main(String args[]) {\n Runner4 "
},
{
"path": "src/main/java/com/basic/chapter0800/TestThread5.java",
"chars": 514,
"preview": "package com.basic.chapter0800;\n\npublic class TestThread5 {\n\tpublic static void main(String args[]){\n\t\tRunner5 r = new Ru"
},
{
"path": "src/main/java/com/basic/chapter0800/TestThread6.java",
"chars": 492,
"preview": "package com.basic.chapter0800;\n\npublic class TestThread6 {\n public static void main(String args[]) {\n Thread t"
},
{
"path": "src/main/java/com/basic/chapter0800/TestYield.java",
"chars": 530,
"preview": "package com.basic.chapter0800;\n\npublic class TestYield {\n public static void main(String[] args) {\n MyThread3 "
},
{
"path": "src/main/java/com/basic/chapter0900/Chapter0901TestUDPClient.java",
"chars": 404,
"preview": "package com.basic.chapter0900;\n\nimport java.net.*;\n\npublic class Chapter0901TestUDPClient {\n public static void main("
},
{
"path": "src/main/java/com/basic/chapter0900/Chapter0901TestUDPServer.java",
"chars": 446,
"preview": "package com.basic.chapter0900;\n\nimport java.net.*;\n\npublic class Chapter0901TestUDPServer {\n public static void main("
},
{
"path": "src/main/java/com/basic/chapter0900/Chat/Chat03/ChatClient.java",
"chars": 831,
"preview": "package com.basic.chapter0900.Chat.Chat03;\n\nimport java.io.*;\nimport java.net.*;\n\npublic class ChatClient {\n Socket s"
},
{
"path": "src/main/java/com/basic/chapter0900/Chat/Chat03/ChatServer.java",
"chars": 1555,
"preview": "package com.basic.chapter0900.Chat.Chat03;\n\nimport java.net.*;\nimport java.util.*;\nimport java.io.*;\n\npublic class ChatS"
},
{
"path": "src/main/java/com/basic/chapter0900/Chat/Chat05/ChatClient.java",
"chars": 1399,
"preview": "package com.basic.chapter0900.Chat.Chat05;\n\nimport java.io.*;\nimport java.net.*;\n\npublic class ChatClient {\n Socket s"
},
{
"path": "src/main/java/com/basic/chapter0900/Chat/Chat05/ChatServer.java",
"chars": 2039,
"preview": "package com.basic.chapter0900.Chat.Chat05;\n\nimport java.net.*;\nimport java.util.*;\nimport java.io.*;\n\npublic class ChatS"
},
{
"path": "src/main/java/com/basic/chapter0900/Chat/Chat07/ChatClient.java",
"chars": 2129,
"preview": "package com.basic.chapter0900.Chat.Chat07;\n\nimport java.io.*;\nimport java.net.*;\nimport java.awt.*;\nimport java.awt.even"
},
{
"path": "src/main/java/com/basic/chapter0900/Chat/Chat07/ChatServer.java",
"chars": 2040,
"preview": "package com.basic.chapter0900.Chat.Chat07;\n\nimport java.net.*;\nimport java.util.*;\nimport java.io.*;\n\npublic class ChatS"
},
{
"path": "src/main/java/com/basic/chapter0900/Chat/Chat10/ChatClient.java",
"chars": 2352,
"preview": "package com.basic.chapter0900.Chat.Chat10;\n\nimport java.io.*;\nimport java.net.*;\nimport java.awt.*;\nimport java.awt.even"
},
{
"path": "src/main/java/com/basic/chapter0900/Chat/Chat10/ChatServer.java",
"chars": 2775,
"preview": "package com.basic.chapter0900.Chat.Chat10;\n\nimport java.net.*;\nimport java.util.*;\nimport java.io.*;\nimport java.awt.*;\n"
},
{
"path": "src/main/java/com/basic/chapter0900/TCPClient.java",
"chars": 393,
"preview": "package com.basic.chapter0900;\n\nimport java.net.*;\nimport java.io.*;\n\npublic class TCPClient {\n\tpublic static void main("
},
{
"path": "src/main/java/com/basic/chapter0900/TCPServer.java",
"chars": 427,
"preview": "package com.basic.chapter0900;\n\nimport java.net.*;\nimport java.io.*;\n\npublic class TCPServer {\n\tpublic static void main("
},
{
"path": "src/main/java/com/basic/chapter0900/TalkClient.java",
"chars": 1026,
"preview": "package com.basic.chapter0900;\n\nimport java.io.*;\nimport java.net.*;\n\npublic class TalkClient {\n public static void m"
},
{
"path": "src/main/java/com/basic/chapter0900/TalkServer.java",
"chars": 1471,
"preview": "package com.basic.chapter0900;\n\nimport java.io.*;\nimport java.net.*;\nimport java.applet.Applet;\n\npublic class TalkServer"
},
{
"path": "src/main/java/com/basic/chapter0900/TestClient.java",
"chars": 537,
"preview": "package com.basic.chapter0900;\n\nimport java.net.*;\nimport java.io.*;\n\npublic class TestClient {\n\tpublic static void main"
},
{
"path": "src/main/java/com/basic/chapter0900/TestServer.java",
"chars": 722,
"preview": "package com.basic.chapter0900;\n\nimport java.net.*;\nimport java.io.*;\n\npublic class TestServer {\n public static void m"
},
{
"path": "src/main/java/com/basic/chapter0900/TestSockClient.java",
"chars": 869,
"preview": "package com.basic.chapter0900;\n\nimport java.net.*;\nimport java.io.*;\n\npublic class TestSockClient {\n public static vo"
},
{
"path": "src/main/java/com/basic/chapter0900/TestSockServer.java",
"chars": 989,
"preview": "package com.basic.chapter0900;\r\rimport java.io.*;\rimport java.net.*;\r\rpublic class TestSockServer {\r public static vo"
},
{
"path": "src/main/java/com/basic/chapter0900/TestUDPClient.java",
"chars": 655,
"preview": "package com.basic.chapter0900;\n\nimport java.net.*;\nimport java.io.*;\n\npublic class TestUDPClient {\n public static voi"
},
{
"path": "src/main/java/com/basic/chapter0900/TestUDPServer.java",
"chars": 565,
"preview": "package com.basic.chapter0900;\n\nimport java.net.*;\nimport java.io.*;\n\npublic class TestUDPServer {\n public static voi"
},
{
"path": "src/main/java/com/basic/chapter0900/zerocopy/traditonal/TraditionalClient.java",
"chars": 1794,
"preview": "package com.basic.chapter0900.zerocopy.traditonal;\n\nimport java.io.DataOutputStream;\nimport java.io.FileInputStream;\nimp"
},
{
"path": "src/main/java/com/basic/chapter0900/zerocopy/traditonal/TraditionalServer.java",
"chars": 1611,
"preview": "package com.basic.chapter0900.zerocopy.traditonal;\n\nimport java.io.DataInputStream;\nimport java.io.IOException;\nimport j"
},
{
"path": "src/main/java/com/basic/chapter0900/zerocopy/transfer/TransferToClient.java",
"chars": 1268,
"preview": "package com.basic.chapter0900.zerocopy.transfer;\n\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport jav"
},
{
"path": "src/main/java/com/basic/chapter0900/zerocopy/transfer/TransferToServer.java",
"chars": 1862,
"preview": "package com.basic.chapter0900.zerocopy.transfer;\n\nimport java.io.IOException;\nimport java.net.InetSocketAddress;\nimport "
},
{
"path": "src/main/java/com/basic/chapter1000/AWTDrawing.java",
"chars": 566,
"preview": "package com.basic.chapter1000;\n\nimport java.awt.*;\n\npublic class AWTDrawing {\n private Frame f = new Frame(\" Hello Ou"
},
{
"path": "src/main/java/com/basic/chapter1000/AWTDrawing2.java",
"chars": 632,
"preview": "package com.basic.chapter1000;\n\nimport java.awt.*;\n\nclass SubPanel extends Panel{\n\tpublic void paint(Graphics g){\n\t\tg.dr"
},
{
"path": "src/main/java/com/basic/chapter1000/CenterPanel.java",
"chars": 574,
"preview": "package com.basic.chapter1000;\n\nimport java.awt.*;\n\npublic class CenterPanel {\n public static void main(String args[]"
},
{
"path": "src/main/java/com/basic/chapter1000/MyMouseAdapter.java",
"chars": 1065,
"preview": "package com.basic.chapter1000;\n\nimport java.awt.*;\nimport java.awt.event.*;\nimport java.util.*;\n\npublic class MyMouseAda"
},
{
"path": "src/main/java/com/basic/chapter1000/MyMouseAdapterGeneric.java",
"chars": 1102,
"preview": "package com.basic.chapter1000;\n\nimport java.awt.*;\nimport java.awt.event.*;\nimport java.util.*;\n\npublic class MyMouseAda"
},
{
"path": "src/main/java/com/basic/chapter1000/NestedContainer.java",
"chars": 632,
"preview": "package com.basic.chapter1000;\n\nimport java.awt.*;\n\npublic class NestedContainer {\n public static void main(String ar"
},
{
"path": "src/main/java/com/basic/chapter1000/TFActionEvent.java",
"chars": 652,
"preview": "package com.basic.chapter1000;\n\nimport java.awt.*;\nimport java.awt.event.*;\n\npublic class TFActionEvent {\n /**\n *"
},
{
"path": "src/main/java/com/basic/chapter1000/TFMath.java",
"chars": 1475,
"preview": "package com.basic.chapter1000;\n\nimport java.awt.*;\nimport java.awt.event.*;\n\npublic class TFMath {\n public static voi"
},
{
"path": "src/main/java/com/basic/chapter1000/TFMathTest.java",
"chars": 1298,
"preview": "package com.basic.chapter1000;\n\nimport java.awt.*;\nimport java.awt.event.*;\n\npublic class TFMathTest extends Frame {\n "
},
{
"path": "src/main/java/com/basic/chapter1000/TFMathTest2.java",
"chars": 1611,
"preview": "package com.basic.chapter1000;\n\nimport java.awt.*;\nimport java.awt.event.*;\n\npublic class TFMathTest2 extends Frame {\n "
},
{
"path": "src/main/java/com/basic/chapter1000/TFPassword.java",
"chars": 682,
"preview": "package com.basic.chapter1000;\n\nimport java.awt.*;\nimport java.awt.event.*;\n\npublic class TFPassword {\n\n /**\n * @"
},
{
"path": "src/main/java/com/basic/chapter1000/TenButtons.java",
"chars": 1084,
"preview": "package com.basic.chapter1000;\n\nimport java.awt.*;\n\npublic class TenButtons {\n public static void main(String args[])"
},
{
"path": "src/main/java/com/basic/chapter1000/Test.java",
"chars": 425,
"preview": "package com.basic.chapter1000;\n\nimport java.awt.*;\n\npublic class Test {\n public static void main(String args[]) {\n "
},
{
"path": "src/main/java/com/basic/chapter1000/TestActionEvent.java",
"chars": 556,
"preview": "package com.basic.chapter1000;\n\nimport java.awt.*;\nimport java.awt.event.*;\n\npublic class TestActionEvent {\n public s"
},
{
"path": "src/main/java/com/basic/chapter1000/TestActionEvent2.java",
"chars": 758,
"preview": "package com.basic.chapter1000;\n\nimport java.awt.*;\nimport java.awt.event.*;\n\npublic class TestActionEvent2 {\n public "
},
{
"path": "src/main/java/com/basic/chapter1000/TestAnonymous.java",
"chars": 836,
"preview": "package com.basic.chapter1000;\n\nimport java.awt.*;\nimport java.awt.event.*;\n\npublic class TestAnonymous {\n Frame f = "
},
{
"path": "src/main/java/com/basic/chapter1000/TestAnonymous2.java",
"chars": 823,
"preview": "package com.basic.chapter1000;\n\nimport java.awt.*;\nimport java.awt.event.*;\n\npublic class TestAnonymous2 {\n Frame f ="
},
{
"path": "src/main/java/com/basic/chapter1000/TestBorderLayout.java",
"chars": 759,
"preview": "package com.basic.chapter1000;\n\nimport java.awt.*;\n\npublic class TestBorderLayout {\n public static void main(String a"
},
{
"path": "src/main/java/com/basic/chapter1000/TestFlowLayout.java",
"chars": 496,
"preview": "package com.basic.chapter1000;\n\nimport java.awt.*;\n\npublic class TestFlowLayout {\n public static void main(String arg"
}
]
// ... and 135 more files (download for full content)
About this extraction
This page contains the full source code of the MarkShen1992/Mashibing_High_Concurrency GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 335 files (58.9 MB), approximately 128.4k tokens, and a symbol index with 1172 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.