码迷,mamicode.com
首页 >  
搜索关键字:static    ( 45277个结果
c# 根据中文汉字获取到拼音
public static String ConvertToPinyin(String str) { if (String.IsNullOrEmpty(str)) return String.Empty; var sb = new Strin...
分类:Windows程序   时间:2015-12-16 15:30:23    阅读次数:455
java设计模式----单例模式
单例模式保证一个类中只有一个实例且该实例易于外界访问。懒汉模式(第一次调用的时候实例化,懒加载)public class SingletonClass{ private static SingletonClass instance=null; public static synchron...
分类:编程语言   时间:2015-12-16 15:22:49    阅读次数:140
数组的常见操作
遍历方式1: public static void printArray(int[] arr) { for(int x=0; x max); max = arr[x]; } return max; }最小值 p...
分类:编程语言   时间:2015-12-16 15:22:46    阅读次数:200
c# delegate 封装 方法的复用 方法里面调用方法
class Program { public delegate int Run(int i, int j); public static void Main(string[] args) { MainFunction(Add);...
分类:Windows程序   时间:2015-12-16 12:23:00    阅读次数:251
单例模式
1 public class SingleInstance 2 { 3 private static SingleInstance singleInstance = null; 4 private static readonly object locker = new object(); 5 pr....
分类:其他好文   时间:2015-12-16 12:06:39    阅读次数:151
swift-单例的写法
OC 中单例的使用+ (instancetype)sharedManager { static id instance; static dispatch_once_t onceToken; NSLog(@"%ld", onceToken); dispatch_once(&on...
分类:编程语言   时间:2015-12-16 01:43:00    阅读次数:213
自己写 el 函数
step 1:写一个java类,定义一个或多个public static 方法,在方法中实现函数的逻辑step 2:在.tld文件中描述该函数可以参考fn.tldstep 3:在jsp文件中,导入并使用函数如,java类如下:1 package myfunc;2 3 public class MyE...
分类:其他好文   时间:2015-12-16 00:30:04    阅读次数:155
比JDK高效的array equals
private static boolean arrEquals(byte[] a1, byte[] a2) { if (a1 == a2) return true; if (a1 == null || a2 == null) ...
分类:其他好文   时间:2015-12-15 22:55:38    阅读次数:383
java逐行读取和写入文本文件txt
逐行写入文本 public class TestFileWriter { public static void main(String[] args) { FileWriter fw = null; try { fw = new FileWriter("d://test.txt",true)...
分类:编程语言   时间:2015-12-15 22:30:59    阅读次数:622
Java 中JOptionPane的基本使用方法
JOptionPane 有助于方便地弹出要求用户提供值或向其发出通知的标准对话框。但是有时候看看API也特别烦,因为方法多,参数多,特别难记忆。这里我给出几种常用的方法供大家参考。 (1) public static int showConfirmDialog(ComponentparentC...
分类:编程语言   时间:2015-12-15 21:13:36    阅读次数:366
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!