最近学习一下 Gradle 自动化构建工具 。看完 Building_and_testing_with_Gradle.pdf感觉还是不够的,还得看看 gradle guide才能体会到自动化构建的快感。
git使用
git 使用
Deep understanding of Arrays.sort()
when I meet this program-Largest Number-Leetcoode.I have no idea how to deal with it.So I know this method-Arrays.sort(T[],comparetor < ? super T> c)
.
Reading-today-one
Factory_Pattern
The Factory pattern provides a way to use an instance as a object factory.The factory can return an instance of one of several possible classes(in a subclass hierarchy),depending on the date provided to it.
Strategy_Pattern
Strategy Pattern
What’s the Strategy Pattern ?
In the Wiki:
- defines a family of algorithms,
- encapsulates each algorithm
- makes the algorithms interchangeable within that family.
Java-Autoboxing-and-Unboxing
Java-Autoboxing-and-Unboxing
Autoboxing and unboxing is introduced in Java1.5 to automatically convert primitive type into boxed primitive(Object or Wrapper class).Autoboxing allows you to use primitive and object type interchangeably in Java on many place like assignment,method invocation.
Java Reflection
Java Reflection
“Reflection is commonly used by programs which require the ability to examine or modify the runtime behavior of applications running in Java Virtual machine.” The concept is ofen mixed with introspecion.The following are their definitions from Wiki:
Avoding magic number
Avoid “magic numbers”
《Code Complete》 SAYS:
Magic numbers are literal numbers such as 100 or 47524 that appear in the middle of a program without explanation.If your program in a language that supports named constants,use them instead.If you can’t use named constants,use global variables when it is feasible to.
多态
多态
多态是继数据抽象和继承之后的第三种基本特征
多态通过分离做什么和怎么做。多态不但能过改善代码额组织结构和可读性,还能够创建可扩展的程序——无论什么时候,需要新功能的时候都能添加。多态的作用是消除类型的耦合关系(耦合:对象之间的依赖性,对象之间耦合度越高,维护成本越高。)