共 151篇 前 10 页: 10    每页10篇 上一页   下一页  

自荐文章

[url] http://www.qall.com/ [/url]

全呼通是网站三维互动情景展示系统,可三维立体展示与互动,播放宣传短片、即时视频、多人洽谈、现场情景化展示销售、主动营销、赢得客户,网站访客只需点击网页中的对话图标,无需安装或下载任何插件,就能直接和网站客服人员进行即时文字语音视频情景化交流。

除了增值服务,而且是免费的哦!

air_tuyh   2007-05-09 10:23:33 阅读:72  评论:0  引用:0

方法索引

clone()
创建与该对象的类相同的新对象。
equals(Object)
比较两对象是否相等。
finalize()
当垃圾回收器确定不存在对该对象的更多引用时,对象的垃圾回收器调用该方法。
getClass()
返回一个对象的运行时间类。
hashCode()
返回该对象的散列码值。
notify()
激活等待在该对象的监视器上的一个线程。
notifyAll()
激活等待在该对象的监视器上的全部线程。
toString()
返回该对象的字符串表示。
wait()
等待这个对象另一个更改线程的通知。
wait(long)
等待这个对象另一个更改线程的通知。
wait(long, int)
等待这个对象另一个更改线程的通知。
air_tuyh   2007-04-28 14:11:34 阅读:46  评论:0  引用:0
"可变"和"不可变",和是不是final没有关系

举个例子:

String str1 = "hello";
String str2 = "world";
String str1 = str1 + str2;//这里所做的内部操作,其实不是把str1的内容改变为原str1+str2的内容这么简单, 而把创建一个新的String, 内容为str1 + str2的内容,然后再把str1这个引用重新指向新创建的String, 这就是上面说的String不可变.

而如果是StringBuffer的话,则直接更改str1的内容,而不是先创建一个新的StringBuffer


使用 StringBuffer 主要就是在性能上的考虑。

String 是一种非常常用的数据类型,但由于 String 是不可变对象,在进行 String 的相关操作的时候会产生许多临时的 String 对象。

而 StringBuffer 在操作上是在一个缓冲中进行的,性能当然优越得多。

不过,一般做为简单的字符串传递和其它操作,只不要改变字符串内容的操作,用 String 效率会高一些。

air_tuyh   2007-04-28 13:29:33 阅读:40  评论:0  引用:0
〖摘要:〗

摘要:
aList.Add("a");
aList.Insert(0,"aa");
aList.InsertRange(2,list2);
aList.Remove("a");
aList.RemoveAt(0);
aList.RemoveRange(1,3);
aList.Sort();//排序
aList.Reverse();//反转
intnIndex=aList.IndexOf(“a”);//1
nIndex=aList.IndexOf(“p”);//没找到,-1
a)publicvirtualintIndexOf(object);
b)publicvirtualintIndexOf(object,int);
c)publicvirtualintIndexOf(object,int,int);
d)publicvirtualintLastIndexOf(object);
e)publicvirtualintLastIndexOf(object,int);
f)publicvirtualintLastIndexOf(object,int,int);
intnIndex=aList.LastIndexOf("a");//值为2而不是0
aList.TrimToSize();//Count=Capacity=5;


System.Collections.ArrayList类是一个特殊的数组。通过添加和删除元素,就可以动态改变数组的长度。

一.优点

1。支持自动改变大小的功能
2。可以灵活的插入元素
3。可以灵活的删除元素

二.局限性

跟一般的数组比起来,速度上差些

三.添加元素

1.publicvirtualintAdd(objectvalue);

将对象添加到ArrayList的结尾处

ArrayListaList=newArrayList();
aList.Add("a");
aList.Add("b");
aList.Add("c");
aList.Add("d");
aList.Add("e");
内容为abcde

2.publicvirtualvoidInsert(intindex,objectvalue);

将元素插入ArrayList的指定索引处

ArrayListaList=newArrayList();
aList.Add("a");
aList.Add("b");
aList.Add("c");
aList.Add("d");
aList.Add("e");
aList.Insert(0,"aa");

结果为aaabcde

3.publicvirtualvoidInsertRange(intindex,ICollectionc);

将集合中的某个元素插入ArrayList的指定索引处

ArrayListaList=newArrayList();
aList.Add("a");
aList.Add("b");
aList.Add("c");
aList.Add("d");
aList.Add("e");
ArrayListlist2=newArrayList();
list2.Add("tt");
list2.Add("ttt");
aList.InsertRange(2,list2);

结果为abtttttcde

四.删除

a)publicvirtualvoidRemove(objectobj);

从ArrayList中移除特定对象的第一个匹配项,注意是第一个

ArrayListaList=newArrayList();
aList.Add("a");
aList.Add("b");
aList.Add("c");
aList.Add("d");
aList.Add("e");
aList.Remove("a");

结果为bcde

2.publicvirtualvoidRemoveAt(intindex);

移除ArrayList的指定索引处的元素

aList.Add("a");
aList.Add("b");
aList.Add("c");
aList.Add("d");
aList.Add("e");
aList.RemoveAt(0);

结果为bcde

3.publicvirtualvoidRemoveRange(intindex,intcount);

从ArrayList中移除一定范围的元素。Index表示索引,count表示从索引处开始的数目

aList.Add("a");
aList.Add("b");
aList.Add("c");
aList.Add("d");
aList.Add("e");
aList.RemoveRange(1,3);

结果为ae

4.publicvirtualvoidClear();

从ArrayList中移除所有元素。

五.排序

a)publicvirtualvoidSort();

对ArrayList或它的一部分中的元素进行排序。

ArrayListaList=newArrayList();
aList.Add("e");
aList.Add("a");
aList.Add("b");
aList.Add("c");
aList.Add("d");
DropDownList1.DataSource=aList;//DropDownListDropDownList1;
DropDownList1.DataBind();

结果为eabcd

ArrayListaList=newArrayList();
aList.Add("a");
aList.Add("b");
aList.Add("c");
aList.Add("d");
aList.Add("e");
aList.Sort();//排序
DropDownList1.DataSource=aList;//DropDownListDropDownList1;
DropDownList1.DataBind();

结果为abcde

b)publicvirtualvoidReverse();

将ArrayList或它的一部分中元素的顺序反转。

ArrayListaList=newArrayList();
aList.Add("a");
aList.Add("b");
aList.Add("c");
aList.Add("d");
aList.Add("e");
aList.Reverse();//反转
DropDownList1.DataSource=aList;//DropDownListDropDownList1;
DropDownList1.DataBind();
结果为edcba

六.查找

a)publicvirtualintIndexOf(object);
b)publicvirtualintIndexOf(object,int);
c)publicvirtualintIndexOf(object,int,int);

返回ArrayList或它的一部分中某个值的第一个匹配项的从零开始的索引。没找到返回-1。

ArrayListaList=newArrayList();
aList.Add("a");
aList.Add("b");
aList.Add("c");
aList.Add("d");
aList.Add("e");
intnIndex=aList.IndexOf(“a”);//1
nIndex=aList.IndexOf(“p”);//没找到,-1
d)publicvirtualintLastIndexOf(object);
e)publicvirtualintLastIndexOf(object,int);
f)publicvirtualintLastIndexOf(object,int,int);

返回ArrayList或
继续阅读其余的  1325 字

air_tuyh   2007-04-28 09:45:17 阅读:57  评论:1  引用:0
   老天给你一手好牌的时候,你要好好打,但是当牌不是很好的时候,你也要好好打,指不定什么时候牌就变好了呢.风水轮流转.创造机会,在没有足够能力创造的时候, 先懂得把握机会.
air_tuyh   2007-04-13 10:57:58 阅读:45  评论:2  引用:0

  痛苦的记忆总是被牢记,快乐的日子很快被忽略,
  都说世界上多半是美好的,我觉得不是------可是人要相信才会快乐,所以我相信.

 

air_tuyh   2007-04-10 12:44:24 阅读:40  评论:0  引用:0

    把多年的兴趣都给丢了,就知道睡觉了.猪年干猪事,我看在我身上得到了完美体现.

    没事喝喝茶,看看电影(人大的电影还真不错),看看喜欢的书,和朋友们闲聊,再有空点就去爬山,看风景,旅游......快乐的沸点越来越低,悲伤的沸点越来越高.

air_tuyh   2007-04-10 11:22:11 阅读:29  评论:0  引用:0

 

   随着年岁的增长,人会变得越来越冷漠,越来越平静?揣测对方的想法,以此作为自己行为的方向标.不知道这样是让自己更不容易受伤害,还是已经伤痕累累.

  

air_tuyh   2007-04-09 12:36:15 阅读:58  评论:2  引用:0

     今天翻看了自己以前写的一些东西,对比一下,现在的自己死气沉沉.我的理想,我的梦..........???

air_tuyh   2007-04-06 13:55:49 阅读:53  评论:4  引用:0
  看聪明人怎么办事,是一种享受.漂亮而不着痕迹.
air_tuyh   2007-04-02 13:48:52 阅读:37  评论:0  引用:0
Copyright@2008 powered by YuLog