为什么要用简单工厂模式:
我们都知道程序是分开的,客户端中有程序,服务器端有程序,一般来说我们写的main方法中的程序都是在客户端电脑中的,按照我们学习的时候喜欢的写法:
//一般来说这个程序都是在客户电脑中,俗称调用者
public class Text{
public static void main(String[] args) {
Person p = new ...
分类:
编程语言 时间:
2015-01-02 14:43:39
阅读次数:
201
本文以在command窗口执行最简单的 gradle -v 为例子说明从上文提到的EntryPoint.java开始,调用该类的doAction实际调用到Main.java 的doAction protected void doAction(String[] args, ExecutionListener listener) {
createActionFactory()....
分类:
其他好文 时间:
2015-01-02 14:42:25
阅读次数:
135
Given a string containing only digits, restore it by returning all possible valid IP address combinations.For example:Given"25525511135",return["255.2...
分类:
其他好文 时间:
2015-01-02 13:24:09
阅读次数:
185
var?l?sync.Mutex
var?a?string
func?f()?{
a?=?"hello,?world"
l.Unlock()
}
func?main()?{
l.Lock()
go?f()
l.Lock()
print(a)
} sync 包中实现了两个关于锁的数据类型,sync.Mutex 和 sy...
分类:
编程语言 时间:
2015-01-02 12:23:57
阅读次数:
181
SHOTCUTSDescriptionhistory显示命令历史列表Ctrl+p显示上一条命令Ctrl+n显示下一条命令!num执行命令历史列表的第num条命令!!执行上一条命令!?string?执行含有string字符串的最新命令Ctrl+r然后输入若干字符,开始向上搜索包含该字符的命令,继续按C...
分类:
系统相关 时间:
2015-01-02 12:14:06
阅读次数:
251
可对照查看网盘ASCII表 public static void main(String[] args) { // // TODO Auto-generated method stub int a=001; int b=32;//制表符 int c=13;//回车键 char charac...
分类:
编程语言 时间:
2015-01-02 12:13:34
阅读次数:
504
默认的时候,-128——127范围内的数会被缓冲 但是jvm启动的时候可以修改启动参数-Djava.lang.Integer.IntegerCache.high=2000 来修改上限,但是下限是不可以修改的。 public static void main(String[] args) { Inte...
分类:
其他好文 时间:
2015-01-02 12:06:57
阅读次数:
156
题目:(DP)Given a stringSand a stringT, count the number of distinct subsequences ofTinS.A subsequence of a string is a new string which is formed from t...
分类:
其他好文 时间:
2015-01-02 10:55:22
阅读次数:
120
1.编译带有包声明的JAVA类
package aa;
public class B {
public static void main(String[] args)
{
System.out.println("f");
}
}
用JAVAC编译完这个文件时,如果直接用java B 来执行的话,会报错
Exception in thread "main" java.lang....
分类:
编程语言 时间:
2015-01-02 09:50:20
阅读次数:
163
package?org.web.proxy;
import?java.lang.reflect.Method;
public?class?Context?implements?MethodProxy?{
public?String?method?=?null;
public?String?service?=?null;
public?S...
分类:
其他好文 时间:
2015-01-02 06:30:41
阅读次数:
140