Java工程师成神之路 --一篇非常好的文章,让人获益匪浅!!!

2024-09-04 12:48

本文主要是介绍Java工程师成神之路 --一篇非常好的文章,让人获益匪浅!!!,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

一、基础篇

1.1 JVM

1.1.1. Java内存模型,Java内存管理,Java堆和栈,垃圾回收

http://www.jcp.org/en/jsr/detail?id=133
http://ifeve.com/jmm-faq/

1.1.2. 了解JVM各种参数及调优
1.1.3. 学习使用Java工具

jps, jstack, jmap, jconsole, jinfo, jhat, javap, …
http://kenai.com/projects/btrace
http://www.crashub.org/
https://github.com/taobao/TProfiler
https://github.com/CSUG/HouseMD
http://wiki.cyclopsgroup.org/jmxterm
https://github.com/jlusdy/TBJMap

1.1.4. 学习Java诊断工具

http://www.eclipse.org/mat/
http://visualvm.java.net/oqlhelp.html

1.1.5. 自己编写各种outofmemory,stackoverflow程序

HeapOutOfMemory
Young OutOfMemory
MethodArea OutOfMemory
ConstantPool OutOfMemory
DirectMemory OutOfMemory
Stack OutOfMemory
Stack OverFlow

1.1.6. 使用工具尝试解决以下问题,并写下总结

当一个Java程序响应很慢时如何查找问题
当一个Java程序频繁FullGC时如何解决问题,如何查看垃圾回收日志
当一个Java应用发生OutOfMemory时该如何解决,年轻代、年老代、永久代解决办法不同,导致原因也不同

1.1.7. 参考资料

http://docs.oracle.com/javase/specs/jvms/se7/html/
http://www.cs.umd.edu/~pugh/java/memoryModel/
http://gee.cs.oswego.edu/dl/jmm/cookbook.html

1.2. Java基础知识

1.2.1. 阅读源代码

java.lang.String
java.lang.Integer
java.lang.Long
java.lang.Enum
java.math.BigDecimal
java.lang.ThreadLocal
java.lang.ClassLoader & java.net.URLClassLoader
java.util.ArrayList & java.util.LinkedList
java.util.HashMap & java.util.LinkedHashMap & java.util.TreeMap
java.util.HashSet & java.util.LinkedHashSet & java.util.TreeSet

1.2.2. 熟悉Java中各种变量类型
1.2.3. 熟悉Java String的使用,熟悉String的各种函数
1.2.4. 熟悉Java中各种关键字
1.2.5. 学会使用List,Map,Stack,Queue,Set

上述数据结构的遍历
上述数据结构的使用场景
Java实现对Array/List排序
java.uti.Arrays.sort()
java.util.Collections.sort()
Java实现对List去重
Java实现对List去重,并且需要保留数据原始的出现顺序
Java实现最近最少使用cache,用LinkedHashMap

1.2.6. Java IO&Java NIO,并学会使用

java.io.*
java.nio.*
nio和reactor设计模式
文件编码,字符集

1.2.7. Java反射与javassist

反射与工厂模式
java.lang.reflect.*

1.2.8. Java序列化

java.io. Serializable
什么是序列化,为什么序列化
序列化与单例模式
google序列化protobuf

1.2.9. 虚引用,弱引用,软引用

java.lang.ref.*
实验这些引用的回收

1.2.10. 熟悉Java系统属性

java.util.Properties

1.2.11. 熟悉Annotation用法

java.lang.annotation.*

1.2.12. JMS

javax.jms.*

1.2.13. JMX

java.lang.management.*
javax.management.*

1.2.14. 泛型和继承,泛型和擦除
1.2.15. 自动拆箱装箱与字节码
1.2.16. 实现Callback
1.2.17. java.lang.Void类使用
1.2.18. Java Agent,premain函数

java.lang.instrument

1.2.19. 单元测试

Junit,http://junit.org/
Jmockit,https://code.google.com/p/jmockit/
djUnit,http://works.dgic.co.jp/djunit/

1.2.20. Java实现通过正则表达式提取一段文本中的电子邮件,并将@替换为#输出

java.lang.util.regex.*

1.2.21. 学习使用常用的Java工具库

commons.lang, commons.*…
guava-libraries
netty

1.2.22. 什么是API&SPI

http://en.wikipedia.org/wiki/Application_programming_interface
http://en.wikipedia.org/wiki/Service_provider_interface

1.2.23. 参考资料

JDK src.zip 源代码
http://openjdk.java.net/
http://commons.apache.org/
https://code.google.com/p/guava-libraries/
http://netty.io/
http://stackoverflow.com/questions/2954372/difference-between-spi-and-api
http://stackoverflow.com/questions/11404230/how-to-implement-the-api-spi-pattern-in-java

1.3. Java并发编程

1.3.1. 阅读源代码,并学会使用

java.lang.Thread
java.lang.Runnable
java.util.concurrent.Callable
java.util.concurrent.locks.ReentrantLock
java.util.concurrent.locks.ReentrantReadWriteLock
java.util.concurrent.atomic.Atomic*
java.util.concurrent.Semaphore
java.util.concurrent.CountDownLatch
java.util.concurrent.CyclicBarrier
java.util.concurrent.ConcurrentHashMap
java.util.concurrent.Executors

1.3.2. 学习使用线程池,自己设计线程池需要注意什么
1.3.3. 锁

什么是锁,锁的种类有哪些,每种锁有什么特点,适用场景是什么
在并发编程中锁的意义是什么

1.3.4. synchronized的作用是什么,synchronized和lock
1.3.5. sleep和wait
1.3.6. wait和notify
1.3.7. 写一个死锁的程序
1.3.8. 什么是守护线程,守护线程和非守护线程的区别以及用法
1.3.9. volatile关键字的理解

C++ volatile关键字和Java volatile关键字
happens-before语义
编译器指令重排和CPU指令重排
http://en.wikipedia.org/wiki/Memory_ordering
http://en.wikipedia.org/wiki/Volatile_variable
http://preshing.com/20130702/the-happens-before-relation/

1.3.10. 以下代码是不是线程安全?为什么?如果为count加上volatile修饰是否能够做到线程安全?你觉得该怎么做是线程安全的?
<code style="font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; padding: 0px; color: inherit; background-color: transparent;"><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">public</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">class</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="typ" style="color: rgb(166, 226, 46);"><span class="typ">Sample</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">{</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"></span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">private</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">static</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">int</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> count </span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">=</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">0</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">;</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"></span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">public</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">static</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">void</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> increment</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">()</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">{</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">count</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">++;</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"></span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">}</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">
</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">}</span></span></code>
1.3.11. 解释一下下面两段代码的差别
<code style="font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; padding: 0px; color: inherit; background-color: transparent;"><span class="com" style="color: rgb(147, 161, 161);"><span class="com">// 代码1</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">
</span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">public</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">class</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="typ" style="color: rgb(166, 226, 46);"><span class="typ">Sample</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">{</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"></span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">private</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">static</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">int</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> count </span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">=</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">0</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">;</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"></span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">synchronized</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">public</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">static</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">void</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> increment</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">()</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">{</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">count</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">++;</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"></span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">}</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">
</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">}</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"></span></span><span class="com" style="color: rgb(147, 161, 161);"><span class="com">// 代码2</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">
</span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">public</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">class</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="typ" style="color: rgb(166, 226, 46);"><span class="typ">Sample</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">{</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"></span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">private</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">static</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="typ" style="color: rgb(166, 226, 46);"><span class="typ">AtomicInteger</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> count </span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">=</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">new</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="typ" style="color: rgb(166, 226, 46);"><span class="typ">AtomicInteger</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">(</span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">0</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">);</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"></span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">public</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">static</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">void</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> increment</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">()</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">{</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">count</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">.</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">getAndIncrement</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">();</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"></span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">}</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">
</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">}</span></span></code>
1.3.12. 参考资料

http://book.douban.com/subject/10484692/
http://www.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html

二、 进阶篇

2.1. Java底层知识

2.1.1. 学习了解字节码、class文件格式

http://en.wikipedia.org/wiki/Java_class_file
http://en.wikipedia.org/wiki/Java_bytecode
http://en.wikipedia.org/wiki/Java_bytecode_instruction_listings
http://www.csg.ci.i.u-tokyo.ac.jp/~chiba/javassist/
http://asm.ow2.org/

2.1.2. 写一个程序要求实现javap的功能(手工完成,不借助ASM等工具)

如Java源代码:

<code style="font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; padding: 0px; color: inherit; background-color: transparent;"><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">  </span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">public</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">static</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">void</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> main</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">(</span></span><span class="typ" style="color: rgb(166, 226, 46);"><span class="typ">String</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">[]</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> args</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">)</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">{</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"></span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">int</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> i </span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">=</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">0</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">;</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">i </span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">+=</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">1</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">;</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">i </span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">*=</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">1</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">;</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"></span></span><span class="typ" style="color: rgb(166, 226, 46);"><span class="typ">System</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">.</span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">out</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">.</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">println</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">(</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">i</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">);</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"></span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">}</span></span></code>

编译后读取class文件输出以下代码:

<code style="font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; padding: 0px; color: inherit; background-color: transparent;"><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">public</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">static</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">void</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> main</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">(</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">java</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">.</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">lang</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">.</span></span><span class="typ" style="color: rgb(166, 226, 46);"><span class="typ">String</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">[]);</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"></span></span><span class="typ" style="color: rgb(166, 226, 46);"><span class="typ">Code</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">:</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"></span></span><span class="typ" style="color: rgb(166, 226, 46);"><span class="typ">Stack</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">=</span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">2</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">,</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="typ" style="color: rgb(166, 226, 46);"><span class="typ">Locals</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">=</span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">2</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">,</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="typ" style="color: rgb(166, 226, 46);"><span class="typ">Args_size</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">=</span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">1</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"></span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">0</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">:</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">   iconst_0</span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">1</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">:</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">   istore_1</span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">2</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">:</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">   iinc    </span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">1</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">,</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">1</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"></span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">5</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">:</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">   iload_1</span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">6</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">:</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">   iconst_1</span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">7</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">:</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">   imul</span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">8</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">:</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">   istore_1</span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">9</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">:</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">   getstatic       </span></span><span class="com" style="color: rgb(147, 161, 161);"><span class="com">#2; //Field java/lang/System.out:Ljava/io/PrintStream;</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"></span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">12</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">:</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">  iload_1</span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">13</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">:</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">  invokevirtual   </span></span><span class="com" style="color: rgb(147, 161, 161);"><span class="com">#3; //Method java/io/PrintStream.println:(I)V</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"></span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">16</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">:</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">  </span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">return</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"></span></span><span class="typ" style="color: rgb(166, 226, 46);"><span class="typ">LineNumberTable</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">:</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> line </span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">4</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">:</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">0</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">line </span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">5</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">:</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">2</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">line </span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">6</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">:</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">5</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">line </span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">7</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">:</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">9</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">line </span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">8</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">:</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">16</span></span></code>
2.1.3. CPU缓存,L1,L2,L3和伪共享

http://duartes.org/gustavo/blog/post/intel-cpu-caches/
http://mechanical-sympathy.blogspot.com/2011/07/false-sharing.html

2.1.4. 什么是尾递归
2.1.5. 熟悉位运算

用位运算实现加、减、乘、除、取余

2.1.6. 参考资料

http://book.douban.com/subject/1138768/
http://book.douban.com/subject/6522893/
http://en.wikipedia.org/wiki/Java_class_file
http://en.wikipedia.org/wiki/Java_bytecode
http://en.wikipedia.org/wiki/Java_bytecode_instruction_listings

2.2. 设计模式

2.2.1. 实现AOP

CGLIB和InvocationHandler的区别
http://cglib.sourceforge.net/
动态代理模式
Javassist实现AOP
http://www.csg.ci.i.u-tokyo.ac.jp/~chiba/javassist/
ASM实现AOP
http://asm.ow2.org/

2.2.2. 使用模板方法设计模式和策略设计模式实现IOC
2.2.3. 不用synchronized和lock,实现线程安全的单例模式
2.2.4. nio和reactor设计模式
2.2.5. 参考资料

http://asm.ow2.org/
http://cglib.sourceforge.net/
http://www.javassist.org/

2.3. 网络编程知识

2.3.1. Java RMI,Socket,HttpClient
2.3.2. 用Java写一个简单的静态文件的HTTP服务器

实现客户端缓存功能,支持返回304
实现可并发下载一个文件
使用线程池处理客户端请求
使用nio处理客户端请求
支持简单的rewrite规则
上述功能在实现的时候需要满足“开闭原则”

2.3.3. 了解nginx和apache服务器的特性并搭建一个对应的服务器

http://nginx.org/
http://httpd.apache.org/

2.3.4. 用Java实现FTP、SMTP协议
2.3.5. 什么是CDN?如果实现?DNS起到什么作用?

搭建一个DNS服务器
搭建一个 Squid 或 Apache Traffic Server 服务器
http://www.squid-cache.org/
http://trafficserver.apache.org/
http://en.wikipedia.org/wiki/Domain_Name_System

2.3.6. 参考资料

http://www.ietf.org/rfc/rfc2616.txt
http://tools.ietf.org/rfc/rfc5321.txt
http://en.wikipedia.org/wiki/Open/closed_principle

2.4. 框架知识

spring,spring mvc,阅读主要源码
ibatis,阅读主要源码
用spring和ibatis搭建java server

2.5. 应用服务器知识

熟悉使用jboss,https://www.jboss.org/overview/
熟悉使用tomcat,http://tomcat.apache.org/
熟悉使用jetty,http://www.eclipse.org/jetty/

三、 高级篇

3.1. 编译原理知识

3.1.1. 用Java实现以下表达式解析并返回结果(语法和Oracle中的select sysdate-1 from dual类似)
<code style="font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; padding: 0px; color: inherit; background-color: transparent;"><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> sysdatesysdate </span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">-</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">1</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">sysdate </span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">-</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">1</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">/</span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">24</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">sysdate </span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">-</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">1</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">/(</span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">12</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">*</span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">2</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">)</span></span></code>
3.1.2. 实现对一个List通过DSL筛选
<code style="font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; padding: 0px; color: inherit; background-color: transparent;"><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">  </span></span><span class="typ" style="color: rgb(166, 226, 46);"><span class="typ">QList</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun"><</span></span><span class="typ" style="color: rgb(166, 226, 46);"><span class="typ">Map</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun"><</span></span><span class="typ" style="color: rgb(166, 226, 46);"><span class="typ">String</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">,</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="typ" style="color: rgb(166, 226, 46);"><span class="typ">Object</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">>></span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> mapList </span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">=</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">new</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="typ" style="color: rgb(166, 226, 46);"><span class="typ">QList</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun"><</span></span><span class="typ" style="color: rgb(166, 226, 46);"><span class="typ">Map</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun"><</span></span><span class="typ" style="color: rgb(166, 226, 46);"><span class="typ">String</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">,</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="typ" style="color: rgb(166, 226, 46);"><span class="typ">Object</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">>>;</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">mapList</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">.</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">add</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">({</span></span><span class="str" style="color: rgb(230, 219, 116);"><span class="str">"name"</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">:</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="str" style="color: rgb(230, 219, 116);"><span class="str">"hatter test"</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">});</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">mapList</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">.</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">add</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">({</span></span><span class="str" style="color: rgb(230, 219, 116);"><span class="str">"id"</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">:</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">-</span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">1</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">,</span></span><span class="str" style="color: rgb(230, 219, 116);"><span class="str">"name"</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">:</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="str" style="color: rgb(230, 219, 116);"><span class="str">"hatter test"</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">});</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">mapList</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">.</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">add</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">({</span></span><span class="str" style="color: rgb(230, 219, 116);"><span class="str">"id"</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">:</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">0</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">,</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="str" style="color: rgb(230, 219, 116);"><span class="str">"name"</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">:</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="str" style="color: rgb(230, 219, 116);"><span class="str">"hatter test"</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">});</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">mapList</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">.</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">add</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">({</span></span><span class="str" style="color: rgb(230, 219, 116);"><span class="str">"id"</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">:</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">1</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">,</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="str" style="color: rgb(230, 219, 116);"><span class="str">"name"</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">:</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="str" style="color: rgb(230, 219, 116);"><span class="str">"test test"</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">});</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">mapList</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">.</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">add</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">({</span></span><span class="str" style="color: rgb(230, 219, 116);"><span class="str">"id"</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">:</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">2</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">,</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="str" style="color: rgb(230, 219, 116);"><span class="str">"name"</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">:</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="str" style="color: rgb(230, 219, 116);"><span class="str">"hatter test"</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">});</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">mapList</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">.</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">add</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">({</span></span><span class="str" style="color: rgb(230, 219, 116);"><span class="str">"id"</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">:</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">3</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">,</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="str" style="color: rgb(230, 219, 116);"><span class="str">"name"</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">:</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="str" style="color: rgb(230, 219, 116);"><span class="str">"test hatter"</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">});</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">mapList</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">.</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">query</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">(</span></span><span class="str" style="color: rgb(230, 219, 116);"><span class="str">"id is not null and id > 0 and name like '%hatter%'"</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">);</span></span></code>

要求返回列表中匹配的对象,即最后两个对象;

3.1.3. 用Java实现以下程序(语法和变量作用域处理都和JavaScript类似):

代码:

<code style="font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; padding: 0px; color: inherit; background-color: transparent;"><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">var</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> a </span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">=</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">1</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">;</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">
</span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">var</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> b </span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">=</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">2</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">;</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">
</span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">var</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> c </span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">=</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">function</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">()</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">{</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"></span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">var</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> a </span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">=</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">3</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">;</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">println</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">(</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">a</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">);</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">println</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">(</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">b</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">);</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">
</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">};</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">
c</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">();</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">
println</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">(</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">a</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">);</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">
println</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">(</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">b</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">);</span></span></code>

输出:

<code style="font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; padding: 0px; color: inherit; background-color: transparent;"><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">3</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">
</span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">2</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">
</span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">1</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">
</span></span><span class="lit" style="color: rgb(174, 129, 255);"><span class="lit">2</span></span></code>
3.1.4. 参考资料

http://en.wikipedia.org/wiki/Abstract_syntax_tree
https://javacc.java.net/
http://www.antlr.org/

3.2. 操作系统知识

Ubuntu
Centos
使用linux,熟悉shell脚本

3.3. 数据存储知识

3.3.1. 关系型数据库

MySQL
如何看执行计划
如何搭建MySQL主备
binlog是什么
Derby,H2,PostgreSQL
SQLite

3.3.2. NoSQL

Cache
Redis
Memcached
Leveldb
Bigtable
HBase
Cassandra
Mongodb
图数据库
neo4j

3.3.3. 参考资料

http://db-engines.com/en/ranking
http://redis.io/
https://code.google.com/p/leveldb/
http://hbase.apache.org/
http://cassandra.apache.org/
http://www.mongodb.org/
http://www.neo4j.org/

3.4. 大数据知识

3.4.1. Zookeeper,在linux上部署zk
3.4.2. Solr,Lucene,ElasticSearch

在linux上部署solr,solrcloud,,新增、删除、查询索引

3.4.3. Storm,流式计算,了解Spark,S4

在linux上部署storm,用zookeeper做协调,运行storm hello world,local和remote模式运行调试storm topology。

3.4.4. Hadoop,离线计算

Hdfs:部署NameNode,SecondaryNameNode,DataNode,上传文件、打开文件、更改文件、删除文件
MapReduce:部署JobTracker,TaskTracker,编写mr job
Hive:部署hive,书写hive sql,得到结果
Presto:类hive,不过比hive快,非常值得学习

3.4.5. 分布式日志收集flume,kafka,logstash
3.4.6. 数据挖掘,mahout
3.4.7. 参考资料

http://zookeeper.apache.org/
https://lucene.apache.org/solr/
https://github.com/nathanmarz/storm/wiki
http://hadoop.apache.org/
http://prestodb.io/
http://flume.apache.org/,http://logstash.net/,http://kafka.apache.org/
http://mahout.apache.org/

3.5. 网络安全知识

3.5.1. 什么是DES、AES
3.5.2. 什么是RSA、DSA
3.5.3. 什么是MD5,SHA1
3.5.4. 什么是SSL、TLS,为什么HTTPS相对比较安全
3.5.5. 什么是中间人攻击、如果避免中间人攻击
3.5.6. 什么是DOS、DDOS、CC攻击
3.5.7. 什么是CSRF攻击
3.5.8. 什么是CSS攻击
3.5.9. 什么是SQL注入攻击
3.5.10. 什么是Hash碰撞拒绝服务攻击
3.5.11. 了解并学习下面几种增强安全的技术

http://www.openauthentication.org/
HOTP http://www.ietf.org/rfc/rfc4226.txt
TOTP http://tools.ietf.org/rfc/rfc6238.txt
OCRA http://tools.ietf.org/rfc/rfc6287.txt
http://en.wikipedia.org/wiki/Salt_(cryptography)

3.5.12. 用openssl签一个证书部署到apache或nginx
3.5.13. 参考资料

http://en.wikipedia.org/wiki/Cryptographic_hash_function
http://en.wikipedia.org/wiki/Block_cipher
http://en.wikipedia.org/wiki/Public-key_cryptography
http://en.wikipedia.org/wiki/Transport_Layer_Security
http://www.openssl.org/
https://code.google.com/p/google-authenticator/

四、 扩展篇

4.1. 相关知识

4.1.1. 云计算,分布式,高可用,可扩展
4.1.2. 虚拟化

https://linuxcontainers.org/
http://www.linux-kvm.org/page/Main_Page
http://www.xenproject.org/
https://www.docker.io/

4.1.3. 监控

http://www.nagios.org/
http://ganglia.info/

4.1.4. 负载均衡

http://www.linuxvirtualserver.org/

4.1.5. 学习使用git

https://github.com/
https://git.oschina.net/

4.1.6. 学习使用maven

http://maven.apache.org/

4.1.7. 学习使用gradle

http://www.gradle.org/

4.1.8. 学习一个小语种语言

Groovy
Scala
LISP, Common LISP, Schema, Clojure
R
Julia
Lua
Ruby

4.1.9. 尝试了解编码的本质

了解以下概念
ASCII, ISO-8859-1
GB2312, GBK, GB18030
Unicode, UTF-8
不使用 String.getBytes() 等其他工具类/函数完成下面功能

<code style="font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; padding: 0px; color: inherit; background-color: transparent;"><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">public</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">static</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">void</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> main</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">(</span></span><span class="typ" style="color: rgb(166, 226, 46);"><span class="typ">String</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">[]</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> args</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">)</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">throws</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="typ" style="color: rgb(166, 226, 46);"><span class="typ">IOException</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">{</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"></span></span><span class="typ" style="color: rgb(166, 226, 46);"><span class="typ">String</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> str </span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">=</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="str" style="color: rgb(230, 219, 116);"><span class="str">"Hello, 我们是中国人。"</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">;</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"></span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">byte</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">[]</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> utf8Bytes </span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">=</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> toUTF8Bytes</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">(</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">str</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">);</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"></span></span><span class="typ" style="color: rgb(166, 226, 46);"><span class="typ">FileOutputStream</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> fos </span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">=</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">new</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="typ" style="color: rgb(166, 226, 46);"><span class="typ">FileOutputStream</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">(</span></span><span class="str" style="color: rgb(230, 219, 116);"><span class="str">"f.txt"</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">);</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">fos</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">.</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">write</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">(</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">utf8Bytes</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">);</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">fos</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">.</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">close</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">();</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">
</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">}</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">
</span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">public</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">static</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">byte</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">[]</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> toUTF8Bytes</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">(</span></span><span class="typ" style="color: rgb(166, 226, 46);"><span class="typ">String</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> str</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">)</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">{</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"></span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">return</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="kwd" style="color: rgb(249, 38, 89);"><span class="kwd">null</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">;</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln"> </span></span><span class="com" style="color: rgb(147, 161, 161);"><span class="com">// TODO</span></span><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">
</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">}</span></span></code>

想一下上面的程序能不能写一个转GBK的?
写个程序自动判断一个文件是哪种编码

4.1.10. 尝试了解时间的本质

时区 & 冬令时、夏令时
http://en.wikipedia.org/wiki/Time_zone
ftp://ftp.iana.org/tz/data/asia
http://zh.wikipedia.org/wiki/%E4%B8%AD%E5%9C%8B%E6%99%82%E5%8D%80
闰年
http://en.wikipedia.org/wiki/Leap_year
闰秒
ftp://ftp.iana.org/tz/data/leapseconds
System.currentTimeMillis() 返回的时间是什么

4.1.11. 参考资料

http://git-scm.com/
http://en.wikipedia.org/wiki/UTF-8
http://www.iana.org/time-zones

4.2. 扩展学习

4.2.1. JavaScript知识
4.2.1.1. 什么是prototype

修改代码,使程序输出“1 3 5”:
http://jsfiddle.net/Ts7Fk/

4.2.1.2. 什么是闭包

看一下这段代码,并解释一下为什么按Button1时没有alert出“This is button: 1”,如何修改:
http://jsfiddle.net/FDPj3/1/

4.2.1.3. 了解并学习一个JS框架

jQuery
ExtJS
ArgularJS

4.2.1.4. 写一个Greasemonkey插件
<code style="font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; padding: 0px; color: inherit; background-color: transparent;"><span class="pln" style="color: rgb(102, 217, 239);"><span class="pln">http</span></span><span class="pun" style="color: rgb(248, 248, 242);"><span class="pun">:</span></span><span class="com" style="color: rgb(147, 161, 161);"><span class="com">//en.wikipedia.org/wiki/Greasemonkey</span></span></code>
4.2.1.5. 学习node.js

http://nodejs.org/

4.2.2. 学习html5

ArgularJS,https://docs.angularjs.org/api

4.2.3. 参考资料

http://www.ecmascript.org/
http://jsfiddle.net/
http://jsbin.com/
http://runjs.cn/
http://userscripts.org/

五、 推荐书籍

《深入Java虚拟机》
《深入理解Java虚拟机》
《Effective Java》
《七周七语言》
《七周七数据》
《Hadoop技术内幕》
《Hbase In Action》
《Mahout In Action》
《这就是搜索引擎》
《Solr In Action》
《深入分析Java Web技术内幕》
《大型网站技术架构》
《高性能MySQL》
《算法导论》
《计算机程序设计艺术》
《代码大全》
《JavaScript权威指南》

这篇关于Java工程师成神之路 --一篇非常好的文章,让人获益匪浅!!!的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1136074

相关文章

JVM 的类初始化机制

前言 当你在 Java 程序中new对象时,有没有考虑过 JVM 是如何把静态的字节码(byte code)转化为运行时对象的呢,这个问题看似简单,但清楚的同学相信也不会太多,这篇文章首先介绍 JVM 类初始化的机制,然后给出几个易出错的实例来分析,帮助大家更好理解这个知识点。 JVM 将字节码转化为运行时对象分为三个阶段,分别是:loading 、Linking、initialization

Spring Security 基于表达式的权限控制

前言 spring security 3.0已经可以使用spring el表达式来控制授权,允许在表达式中使用复杂的布尔逻辑来控制访问的权限。 常见的表达式 Spring Security可用表达式对象的基类是SecurityExpressionRoot。 表达式描述hasRole([role])用户拥有制定的角色时返回true (Spring security默认会带有ROLE_前缀),去

浅析Spring Security认证过程

类图 为了方便理解Spring Security认证流程,特意画了如下的类图,包含相关的核心认证类 概述 核心验证器 AuthenticationManager 该对象提供了认证方法的入口,接收一个Authentiaton对象作为参数; public interface AuthenticationManager {Authentication authenticate(Authenti

Spring Security--Architecture Overview

1 核心组件 这一节主要介绍一些在Spring Security中常见且核心的Java类,它们之间的依赖,构建起了整个框架。想要理解整个架构,最起码得对这些类眼熟。 1.1 SecurityContextHolder SecurityContextHolder用于存储安全上下文(security context)的信息。当前操作的用户是谁,该用户是否已经被认证,他拥有哪些角色权限…这些都被保

Spring Security基于数据库验证流程详解

Spring Security 校验流程图 相关解释说明(认真看哦) AbstractAuthenticationProcessingFilter 抽象类 /*** 调用 #requiresAuthentication(HttpServletRequest, HttpServletResponse) 决定是否需要进行验证操作。* 如果需要验证,则会调用 #attemptAuthentica

Spring Security 从入门到进阶系列教程

Spring Security 入门系列 《保护 Web 应用的安全》 《Spring-Security-入门(一):登录与退出》 《Spring-Security-入门(二):基于数据库验证》 《Spring-Security-入门(三):密码加密》 《Spring-Security-入门(四):自定义-Filter》 《Spring-Security-入门(五):在 Sprin

Java架构师知识体认识

源码分析 常用设计模式 Proxy代理模式Factory工厂模式Singleton单例模式Delegate委派模式Strategy策略模式Prototype原型模式Template模板模式 Spring5 beans 接口实例化代理Bean操作 Context Ioc容器设计原理及高级特性Aop设计原理Factorybean与Beanfactory Transaction 声明式事物

Java进阶13讲__第12讲_1/2

多线程、线程池 1.  线程概念 1.1  什么是线程 1.2  线程的好处 2.   创建线程的三种方式 注意事项 2.1  继承Thread类 2.1.1 认识  2.1.2  编码实现  package cn.hdc.oop10.Thread;import org.slf4j.Logger;import org.slf4j.LoggerFactory

JAVA智听未来一站式有声阅读平台听书系统小程序源码

智听未来,一站式有声阅读平台听书系统 🌟&nbsp;开篇:遇见未来,从“智听”开始 在这个快节奏的时代,你是否渴望在忙碌的间隙,找到一片属于自己的宁静角落?是否梦想着能随时随地,沉浸在知识的海洋,或是故事的奇幻世界里?今天,就让我带你一起探索“智听未来”——这一站式有声阅读平台听书系统,它正悄悄改变着我们的阅读方式,让未来触手可及! 📚&nbsp;第一站:海量资源,应有尽有 走进“智听

在cscode中通过maven创建java项目

在cscode中创建java项目 可以通过博客完成maven的导入 建立maven项目 使用快捷键 Ctrl + Shift + P 建立一个 Maven 项目 1 Ctrl + Shift + P 打开输入框2 输入 "> java create"3 选择 maven4 选择 No Archetype5 输入 域名6 输入项目名称7 建立一个文件目录存放项目,文件名一般为项目名8 确定