码迷,mamicode.com
首页 >  
搜索关键字:private/static/this    ( 3141个结果
java 实现支持多线程的单件模式
在我们写程序时,经常会用到单件模式,单件模式是一个类只拥有一个实例对象(或者拥有多个固定数量的实例对象)。下面我给出一个使用多线程的单件模式demo。 package com; public class Single { private static Single _instance = null; private static Object lock =  new...
分类:编程语言   时间:2014-12-26 13:06:52    阅读次数:167
窗体句柄的简单封装及激活指定的窗体
private static void ActivateOtherWindow(string windowName) { var other = FindWindow(null, windowName); if (other ...
分类:Windows程序   时间:2014-12-26 12:45:51    阅读次数:207
ThreadPoolExecutor使用介绍
private static ExecutorService exec = new ThreadPoolExecutor(8, 8, 0L,TimeUnit.MILLISECONDS, new LinkedBlockingQueue(100000),new ThreadPoolExecutor.Ca...
分类:其他好文   时间:2014-12-26 10:57:19    阅读次数:155
Asp.net中全局缓存的几种方式
public class StaticCacheTest { private static IDictionary _dic; private static object locker = new object(); private...
分类:Web程序   时间:2014-12-26 09:33:46    阅读次数:179
Android中log使用方法
private static final String ACTIVITY_TAG="MainActivity"; Log.v(MainActivity.ACTIVITY_TAG, "This is Verbose.%d"); Log.d(MainActivity.ACTIVITY_TAG, "Thi...
分类:移动开发   时间:2014-12-25 23:24:49    阅读次数:284
Java 字符串类型16进制字面值转成字面值字节数据工具类
private static byte hexValueOf(String hex) { byte result = 0; if (hex.charAt(0) == '0' && (hex.charAt(1) == 'X' || hex.charAt(1) == 'x')) { for (int i = 2; i < hex.length(); i++) { char...
分类:编程语言   时间:2014-12-25 20:34:11    阅读次数:115
公司Android项目公共通用的函数和方法
/** * 一些通用的函数 */ public class FunctionUtil { private static long lastClickTime = 0; /** * 开始用的这种,后来就不限制,调用checkPhone方法。 判断手机格式是否正确,在注册和修改手机号码的时候用到 * * @param mobiles * @return true:正确的手机...
分类:移动开发   时间:2014-12-25 16:30:00    阅读次数:215
设计模式学习--Singleton泛型类
/// /// Singleton泛型类 /// /// public sealed class Singleton where T : new() { private static T instance = new T(); ...
分类:其他好文   时间:2014-12-25 12:54:07    阅读次数:156
用C#读取,写入ini文件
[DllImport("kernel32.dll")] private static extern bool WritePrivateProfileString(string section, string key, string val, string filePath...
分类:Windows程序   时间:2014-12-24 17:59:19    阅读次数:309
使用 COM 类库创建链接桌面快捷方式
用到的 COM 类库:Windows Script Host Object Model -->Interop.IWshRuntimeLibrary.dll示例代码:private static void _BuildLink(){ var startUrl = "http://localhos...
分类:其他好文   时间:2014-12-24 11:34:35    阅读次数:191
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!