花了两个小时时间去看书写例子,遇到不少蛋疼的问题,把例子贴出来,以免忘记
服务器端:
import java.io.*;
import java.net.*;
public class mYServer {
public static void main(String[] args) {
ServerSocket serverSo...
分类:
编程语言 时间:
2014-12-24 13:30:54
阅读次数:
161
1.初始化string s0;string s1("hello");string s2(5, 'a'); //s2 = aaaaa;string s3(s1); // s3 = hellochar str[100] = "aaaaabbbbbaaa...
分类:
其他好文 时间:
2014-12-24 13:16:13
阅读次数:
171
Given a stringSand a stringT, count the number of distinct subsequences ofTinS.A subsequence of a string is a new string which is formed from the orig...
分类:
其他好文 时间:
2014-12-24 11:36:21
阅读次数:
173
1.#include //不可以定义string s;可以用到strcpy等函数using namespace std;#include //可以定义string s;可以用到strcpy等函数using namesapce std;#include //不可以定义string s;可以用到s...
分类:
其他好文 时间:
2014-12-24 11:36:18
阅读次数:
102
/** * 数字转金额格式 * 999999.99 TO 999,999.99 * @param d * @return */ public static String doubleToStr(double d){ Num...
分类:
其他好文 时间:
2014-12-24 11:34:57
阅读次数:
177
1.当使用String str="abc",这种方式时,先去内存的Heap中找是否存在"abc"这个字符串,若存在,则将地址引用。若不存在则创建。2.当使用String str=new String("abc");时,不管事先是否存在"abc",每次都会创建其新的对象。测试一下: String s1...
分类:
其他好文 时间:
2014-12-24 11:34:18
阅读次数:
130
拼接字符串对于程序员来说是再熟悉不过的东西,可是这个东西用了这么确不知道那个性能高些,于是写了点代码来验证。 1 string str = ""; 2 3 DateTime time3 = DateTime.Now; 4 for (int i = 0; i < 200000; i++) 5 {...
分类:
其他好文 时间:
2014-12-24 11:14:39
阅读次数:
171
转载:http://www.cnblogs.com/lori/p/3529936.html代码: static void GetFiles(List arr, string dir) { arr.AddRange(Directory.GetFiles(dir));...
分类:
其他好文 时间:
2014-12-24 09:58:03
阅读次数:
110
User.java 1 package com.user; 2 3 public class User { 4 private String username; 5 private String password; 6 public String getUsername()...
分类:
编程语言 时间:
2014-12-24 09:50:29
阅读次数:
120
void stringCreate() { NSString *str = @"String"; NSLog(@"%@",str); NSString *str1 = [[[NSString alloc] init] autorelease]; str1 = @"String1"; N...
分类:
其他好文 时间:
2014-12-24 09:50:22
阅读次数:
141