替换所有出现的指定元素 : 矢量 « 集合数据结构 « Java

En
Java
1. 图形用户界面
2. 三维图形动画
3. 高级图形
4. 蚂蚁编译
5. Apache类库
6. 统计图
7. 
8. 集合数据结构
9. 数据类型
10. 数据库JDBC
11. 设计模式
12. 开发相关类
13. EJB3
14. 电子邮件
15. 事件
16. 文件输入输出
17. 游戏
18. 泛型
19. GWT
20. Hibernate
21. 本地化
22. J2EE平台
23. 基于J2ME
24. JDK-6
25. JNDI的LDAP
26. JPA
27. JSP技术
28. JSTL
29. 语言基础知识
30. 网络协议
31. PDF格式RTF格式
32. 映射
33. 常规表达式
34. 脚本
35. 安全
36. Servlets
37. Spring
38. Swing组件
39. 图形用户界面
40. SWT-JFace-Eclipse
41. 线程
42. 应用程序
43. Velocity
44. Web服务SOA
45. 可扩展标记语言
Java 教程
Java » 集合数据结构 » 矢量屏幕截图 
替换所有出现的指定元素
 

import java.util.Collections;
import java.util.Vector;

public class Main {
  public static void main(String[] args) {
    Vector<String> v = new Vector<String>();

    v.add("A");
    v.add("B");
    v.add("A");
    v.add("C");
    v.add("D");

    System.out.println(v);
    Collections.replaceAll(v, "A""Replace All");
    System.out.println(v);
  }
}

   
  
Related examples in the same category
1. 向量java.util向量java.util
2. Finding elements in a vectorFinding elements in a vector
3. 序列化序列化
4. 保存矢量文件
5. 创建向量测试
6. Find Vector Find Vector
7. Remove Element in Vector
8. Sequence Sequence
9. 矢量工具
10. 迭代器的矢量
11. Copy Elements of One Java Vector to Another Java Vector
12. Copy Elements of Vector to Java ArrayList
13. Create Java ArrayList From Enumeration
14. 找到最大元素Java矢量
15. 寻找最小元素Java矢量
16. Get Enumeration over Java Vector
17. 执行二进制搜索Java矢量
18. 替换所有内容Java矢量
19. Reverse order of all elements of Java Vector
20. Shuffle内容
21. 交换元素Java矢量
22. 排序Java矢量由高至低使用比较
23. Enumerate through a Vector using Java Enumeration
24. Append all elements of other Collection to Java Vector
25. 复制所有内容
26. Get Size of Java Vector and loop through the elements
27. Get Sub List of Java Vector Example
28. Insert all elements of other Collection to Specified Index of Java Vector
29. Iterate through elements Java Vector using Iterator
30. Iterate through elements Java Vector using ListIterator
31. Remove all elements from Java Vector
32. Remove an element from specified index of Java Vector
33. Remove specified element from Java Vector
34. Replace an element at specified index of Java Vector
35. Search an element of Java Vector
36. Search an element of Java Vector from specific index
37. Set size of Java Vector Example
38. Sort elements of Java Vector
39. Generic Vector with String
40. 计数不同要素矢量
www.java2java.com | Contact Us
Copyright 2010 - 2030 Java Source and Support. All rights reserved.
All other trademarks are property of their respective owners.