Java 6 SE 已经过时了吗? [英] Java 6 SE are vectors obsolete?

查看:38
本文介绍了Java 6 SE 已经过时了吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

package myjava;
import java.util.*;
public class Vectors {
    public static void vec() {
        Vector v = new Vector();
    }
}

我使用的是 net beans IDE 6.9.1,它告诉我这是一个过时的集合".除了显而易见的那个它已经过时了,我还会在 Java 中使用它吗?我对使用它们感到非常兴奋..

I am using net beans IDE 6.9.1 and it tells me it is an "Obsolete Collection". Besides the obvious thats it's obsolete will I ever use it in Java? I was really excited about using them..

推荐答案

不鼓励使用 Vector 已经有一段时间了.它们被替换为 ArrayList,它或多或少具有相同的功能(但不同步).

Use of Vectors have been discouraged for some time now. They are replaced by ArrayList, which has more or less the same functionality (but isn't synchronised).

这篇关于Java 6 SE 已经过时了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆