package ioTest.io1;
import java.util.Iterator;
import java.util.Properties;
import java.util.Set;
/*
* System:
* API描述:public final class System extends Object
* System 类包含一些有用的类字段和方法。它不能被实例化。
...
分类:
编程语言 时间:
2014-05-02 19:04:18
阅读次数:
402
const : 指定字段或者本地变量不能被修改。readonly :
声明一个字段只能在定义的时候赋值或者在构造函数中赋值。( readonly 可以有不同的值,取决于构造函数的值。 const
是一个编译时的常量,readonly是一个运行时的常量,example:public static re...
分类:
其他好文 时间:
2014-05-02 09:26:05
阅读次数:
304
少数次通过 1 public class Solution { 2 public int[]
plusOne(int[] digits) { 3 int[] carry=new int[digits.length+1]; 4 int[]
results=new i...
分类:
其他好文 时间:
2014-05-02 08:23:11
阅读次数:
271
许多次通过,主要是没有考虑到这种情况:“A C ”结尾有多重空格的情况。 1 public class
Solution { 2 public int lengthOfLastWord(String s) { 3 int j, k; 4 if(s == nu...
分类:
其他好文 时间:
2014-05-02 08:21:00
阅读次数:
300
最近在看Jdk6中String的源码的时候发现String的有个这样的构造方法,源代码内容如下:
public String(String original) {
int size = original.count;
char[] originalValue = original.value;
char[] v;
if (originalValue.length > size) {
...
分类:
其他好文 时间:
2014-05-02 06:34:52
阅读次数:
237
#include
using namespace std;
void f(int(&p)[3]){
cout
cout
}
int main(){
int a1[3]={1,2,3};
cout
cout
f(a1);
}
编译后输出:...
分类:
其他好文 时间:
2014-05-02 05:32:02
阅读次数:
265
内容如下:
#include "cocos2d.h"
#include "cocostudio/CocoStudio.h"
//精灵猫和其他精灵的tag
typedef enum{
catTag =1,
};
//cocostudio 动画帧tag
typedef enum{
catWalkTag = 1001,
};
class Base :public coco...
分类:
其他好文 时间:
2014-05-02 05:08:11
阅读次数:
319
一、静态化并不是单例模式
初学者可能会犯的错误, 误以为把所有的成员变量和成员方法都用 static 修饰后, 就是单例模式了:
class Singleton
{
public:
/* static method */
private:
static Singleton m_data; //static data member 在类中声明,在...
分类:
编程语言 时间:
2014-05-02 04:48:34
阅读次数:
541
函数指针
1. 函数与函数指针类型要匹配;
2. 函数指针用来保存函数首地址,即可以通过该指针访问函数;
3. 函数指针可以指向一类函数,而不是一个函数,即可以重新赋值。
int maxNumber(int a, int b)
{
return a > b? a: b;
}
void fileFunc(){ cout
void editFunc(){ ...
分类:
其他好文 时间:
2014-05-02 04:33:25
阅读次数:
276
算法:
#include
using namespace std;
#define MAXSIZE 100
void calNext(const char *T,int *next);//T为模式串,next为预判数组
int kmp_match(const char *S,const char *T);//在主串S中寻找模式串T,如果找到返回其位置,否则返回-1。位置从0开始
void ...
分类:
其他好文 时间:
2014-05-02 02:25:40
阅读次数:
280