Java1.5提供了关键字enum,能够通过该关键字方便得定义自己须要的枚举类型,比方enumSeason{SPRING,SUMMER,AUTUMN,WINTER}就定义了一个季节枚举类型。在本例中,对于Season.SPRING这个对象,Season.SPRING.name()能够得到该对象的字符...
分类:
编程语言 时间:
2014-06-18 14:19:54
阅读次数:
213
package foo;public class Main { public static void bubbleSort(int[] a, int len) { int in, out; for (out = len - 1; out > 0; --out) { ...
分类:
其他好文 时间:
2014-06-18 14:18:37
阅读次数:
158
判断给定的有向图中是否存在负环。 利用 spfa 算法判断负环有两种方法: 1) spfa 的 dfs 形式,判断条件是存在一点在一条路径上出现多次。 2) spfa 的 bfs 形式,判断条件是存在一点入队次数大于总顶点数。 代码如下:法 1 (spfa 的 dfs 形式):#include #i...
分类:
其他好文 时间:
2014-06-18 14:12:46
阅读次数:
1042
private void OpenFolderAndSelectFile(String fileFullName){ System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo("Explo...
分类:
其他好文 时间:
2014-06-18 14:06:16
阅读次数:
219
[HttpPost]public HttpResponseMessage Upload(){string json = "{\"result\":\"true\"}";return new HttpResponseMessage { Content = new StringContent(json,...
string[] imgname; MODEL.Strategy modelMenu = bllMenu.GetModel(int.Parse(strId)); imgname = getPicUrl.getPicUrls(modelMenu...
分类:
其他好文 时间:
2014-06-17 14:12:17
阅读次数:
182
1.复制构造函数可用于:(1)根据另一个同类型的对象显示或隐式初始化一个对象string str1="test"; //隐式string str2=str1; //显示str1为先调用string的字符串形参的构造函数,创建一个临时对象,然后,使用string复制构造函数将str1初始化为那...
分类:
编程语言 时间:
2014-06-17 14:02:29
阅读次数:
156
只需要对word遍历一遍即可 int write(string word) { int cnt = 0; for(int i = 0 ; i < word.length(); ++ i){ cnt+=word[i]-'A'+1; ...
分类:
其他好文 时间:
2014-06-17 14:01:50
阅读次数:
206
在做网络通讯方面的程序时,必不可少的是Socket通讯。那么我们需要有一套既定的,简易的通讯流程。如下:public class PublicSocket { public const string DOWNLOAD_STATUS_WAIT = "1"; publi...
分类:
其他好文 时间:
2014-06-17 13:52:42
阅读次数:
185