摘要:
1. String.trim() trim()方法是去掉一串字符中首、尾空格 2.str.replace(" ", "")replace(" ", "")方法是去掉一串字符中所有空格,包括首尾、中间 String str = " hell o "; String str2 = str.replace 阅读全文
摘要:
首先,Vector类在 java 中可以实现自动增长的对象数组,相比之下使用ArrayList类会比Vector类快,其中ArrayList是非同步的;其次,如果设计涉及到多线程,还是用Vector更甚一筹。1.使用Vector类的代码示例:import java.util.*;/** * 演示Ve... 阅读全文