void getChars(intsrcBegin, intsrcEnd, char[]dst, intdstBegin) 将字符从此字符串复制到目标字符数组。//不能被继承public final class StringBuffer extends AbstractStringBuilder ....
分类:
其他好文 时间:
2014-09-28 13:14:12
阅读次数:
123
字符串循环移位:假设有一串字符串a,b,c,d,e,f,g,h,向左循环移位2为,得c,d,e,f,g,h,a,b。
#include
using namespace std;
void reverse(char* a, int start, int len){
int count = 0;
for(int i = start, j = start + len -1; ; ++i, --...
分类:
其他好文 时间:
2014-09-28 12:28:20
阅读次数:
140
1 package ha; 2 import java.io.*; 3 import java.util.*; 4 5 public class wori 6 { 7 public static void main(String args[]) 8 { 9 ...
分类:
其他好文 时间:
2014-09-28 11:06:11
阅读次数:
176
1 import java.util.ArrayList; 2 3 public class Main { 4 5 public static void main(String[] args) { 6 ArrayList list = new ArrayList...
分类:
编程语言 时间:
2014-09-28 10:39:31
阅读次数:
196
1Thread Runnable接口 1 public class wori 2 { 3 public static void main(String args[]) 4 { 5 Animal a = new Animal(); 6 Thread b...
分类:
其他好文 时间:
2014-09-28 10:33:41
阅读次数:
142
charstr[]={"abcd"}和char*str={"abcd"}的区别char*get_str(void){charstr[]={"abcd"};returnstr;}charstr[]={"abcd"};定义了一个局部字符数组,尽管是数组,但它是一个局部变量,返回它的地址肯定是一个已经释放了的空间的地址。此函数返回的是内部一个局部字符数组str的地址..
分类:
其他好文 时间:
2014-09-28 02:16:41
阅读次数:
185
三种删除String中空格的方法。可用根据需要自由进行选择使用。1、C风格#include "stdafx.h"void RemoveStringSpaces(char* pStr);int _tmain(int argc, _TCHAR* argv[]){ return 0;}void Re...
分类:
其他好文 时间:
2014-09-28 01:37:10
阅读次数:
219
服务器端:public class UDPServer{public static void main(String[] args) throws Exception{byte buf[] = new byte[1024];DatagramPacket dp = new DatagramPacket...
分类:
编程语言 时间:
2014-09-28 00:32:20
阅读次数:
371
服务器端:public class TCPServer{ public static void main(String[]args){ ServerSocket ss = new ServerSocket(6666); while(true){ Socket s = ss.a...
分类:
编程语言 时间:
2014-09-28 00:32:00
阅读次数:
300
public class Example { String str = new String("good"); static StringBuffer sbf=new StringBuffer(); char[] ch = {'a','b','c'}; public static void ...
分类:
其他好文 时间:
2014-09-27 23:44:30
阅读次数:
274