编程开发中为什么要用到单例模式?单例模式的存在,一则,解决多线程并发访问的问题。二则节约系统内存,提交系统运行的效率,提高系统性能。单例模式的代码: 1 public class Printer { 2 private static Printer printer =null;//创建一个私...
分类:
其他好文 时间:
2014-10-15 23:41:01
阅读次数:
230
class SortArrange { public struct SqlList { public int[] data; public int length; } private static...
分类:
编程语言 时间:
2014-10-15 19:08:41
阅读次数:
188
using UnityEngine;using System.Collections;public class DontDel : MonoBehaviour{ public GameObject temp; private static bool m_IsHaveOne =false;...
分类:
其他好文 时间:
2014-10-15 15:38:47
阅读次数:
177
using UnityEngine;using System.Collections;public class Manager : MonoBehaviour{ private static Manager m_Instance; public static Manager insta...
分类:
其他好文 时间:
2014-10-15 14:01:20
阅读次数:
177
/** * 读取15151433862----123456文档 * @param f */ private static void findContent(File f){ String line = null; try { ...
分类:
其他好文 时间:
2014-10-14 20:46:29
阅读次数:
147
十六位的md5加密private static void Md5(String plainText ) { try { MessageDigest md = MessageDigest.getInstance("MD5"); md.update(plainText.getBytes()); byte...
分类:
移动开发 时间:
2014-10-14 00:34:47
阅读次数:
200
最近因为工作关系,需要通过HttpWebRequest去请求API,所有就写了个简单的辅助类,做下备份。public sealed class HttpRequestHelper { private static string USER_AGENT = "Mozilla/5.0 ...
分类:
Web程序 时间:
2014-10-13 21:40:47
阅读次数:
238
1 //修改文件名 2 private static void ReviseFileName(string[] files) 3 { 4 for (int i = 0; i < files.Length; i++) 5 ...
分类:
其他好文 时间:
2014-10-13 18:02:49
阅读次数:
139
1:创建一个CustomNullsFirstInterceptor类public class CustomNullsFirstInterceptor extends EmptyInterceptor { private static final long serialVersionUID = ...
分类:
Web程序 时间:
2014-10-13 14:39:29
阅读次数:
241
1.使用static可以声明一个内部类, 可以直接在外部调用class Outer{ // 定义外部类 private static String info = "hello world" ; // 定义外部类的私有属性 static class Inner{ ...
分类:
编程语言 时间:
2014-10-12 14:09:58
阅读次数:
196