0 .查看当前的线程信息:Thread.CurrentThread.属性 1 private static Thread subthread ; 2 private static Thread subthread1; 3 static void Main(string[] args) 4 { 5 T ...
分类:
编程语言 时间:
2018-05-12 23:30:59
阅读次数:
238
重入锁 1.重入锁基本操作: public class ReentranLockTest implements Runnable{ private static ReentrantLock lock = new ReentrantLock(); public void run() { // TODO ...
分类:
编程语言 时间:
2018-05-12 15:35:35
阅读次数:
198
1 class Program 2 { 3 //构造大象和冰箱 4 private static ElephantsAndFridges elephantsAndFridges = new ElephantsAndFridges(); 5 6 static void Main(string[] ar... ...
分类:
其他好文 时间:
2018-05-12 11:56:01
阅读次数:
167
1 private static async Task IssueClientRequestAsync(string serverName, string message) 2 { 3 Console.WriteLine("进入IssueClientRequestAsync"); 4 //Named... ...
分类:
其他好文 时间:
2018-05-12 11:54:21
阅读次数:
210
单项设计模式是指多个对象实现同一个实例,好处是可以省去new的操作来节省内存空间。分两种写法,一种是饿汉式,一种是懒汉式。 饿汉式: class ehanshi{ private ehanshi(){ }private static ehanshi a=new ehanshi();public st ...
分类:
其他好文 时间:
2018-05-12 03:06:47
阅读次数:
133
1 private static final String WX_AGENT = "micromessenger"; 2 private static final String ALI_AGENT = "alipay"; 3 4 5 public String getBrowser(HttpServ... ...
分类:
微信 时间:
2018-05-11 17:25:22
阅读次数:
510
#region 生成随机数 /// /// /// private static int iCount; /// /// 生成随机数 /// /// public static string GenerateRandomNumber() ... ...
分类:
其他好文 时间:
2018-05-09 16:47:17
阅读次数:
128
/** * 递归方式分解命名空间 * @param namespace * @return 分解后的list集合 */ private static List recursion(String namespace) { int index = namespace.indexOf("."); List... ...
分类:
其他好文 时间:
2018-05-09 12:09:07
阅读次数:
142
/** * * @param inputStream 输入流 * @return 返回数据 */ private static String decompress(InputStream inputStream) { ByteArrayOutputStream bos = new ByteArray... ...
分类:
其他好文 时间:
2018-05-07 19:39:02
阅读次数:
130
class Singleton { private static Singleton instance = null; private Singleton(){} public static Singleton getInstance(){ if(instance==null){ synchroni... ...
分类:
其他好文 时间:
2018-05-07 17:46:37
阅读次数:
146