在JDK1.5 之前,我们定义常量都是: publicstaticfianl....
。现在好了,有了枚举,可以把相关的常量分组到一个枚举类型里,而且枚举提供了比常量更多的方法。Java代码 publicenumColor{
RED,GREEN,BLANK,YELLOW }public enum C...
分类:
编程语言 时间:
2014-05-08 19:12:44
阅读次数:
286
public void RandSort(int[] _num) { Random rd = new
Random(); int temp = 0, tempNum = 0; for (int i = 0; i < _...
分类:
其他好文 时间:
2014-05-08 18:55:19
阅读次数:
257
public class JdbcUtil { private static
ComboPooledDataSource dataSource =new ComboPooledDataSource(); public static
ComboPooledDataSource getDataSourc...
分类:
其他好文 时间:
2014-05-08 14:32:39
阅读次数:
218
c# 获取字符串中的数字 /// /// 获取字符串中的数字 /// /// 字符串 /// 数字
例子1: public static decimal GetNumber(string str) { decimal result = 0; if (str
!= null && str != str...
分类:
其他好文 时间:
2014-05-08 13:32:21
阅读次数:
347
java.lang.String.indexOf(char
ch)方法返回字符ch在指定字符串中第一次出现的下标索引位置如果字符ch在指定的字符串中找不到,则返回-1示例:import
java.lang.*;public class StringDemo { public static void....
分类:
编程语言 时间:
2014-05-08 13:02:04
阅读次数:
423
static class Program { public static
System.Threading.Mutex Run; /// /// 应用程序的主入口点。 /// ...
分类:
其他好文 时间:
2014-05-07 21:01:35
阅读次数:
367
一、单个参数:public List getXXBeanList(String
xxCode); 其中方法名和ID一致,#{}中的参数名与方法中的参数名一直, 我这里采用的是XXXBean是采用的短名字,select
后的字段列表要和bean中的属性名一致, 如果不一致的可以用 as 来补充。...
分类:
其他好文 时间:
2014-05-07 20:41:12
阅读次数:
281
中文分词应用很广泛,网上也有很多开源项目。我在这里主要讲一下中文分词里面算法的简单实现,废话不多说了,现在先上代码
package com;
import java.util.ArrayList;
import java.util.List;
public class Segmentation1 {
private List dictionary = new ArrayList();
...
分类:
其他好文 时间:
2014-05-07 16:30:27
阅读次数:
317
public class Sort {
static void insertSort(int a[], int n) {
for (int i = 1; i < n; i++) {
if (a[i] = 0 && a[k] > temp) {
...
分类:
其他好文 时间:
2014-05-07 16:15:39
阅读次数:
225
#include
#include
using namespace std;
class Point //定义坐标点类
{
public:
Point():x(0),y(0) {};
Point(double x0, double y0):x(x0),y(y0){};
void PrintPoint(); //输出点的信息
double getx()
{
...
分类:
其他好文 时间:
2014-05-07 16:14:20
阅读次数:
267