0

From the SDK

public class Observable {
    private boolean changed = false;
    private Vector obs;

    /** Construct an Observable with zero Observers. */

    public Observable() {
    obs = new Vector();
    }

What is the main reason for using Vector instead of more type-safe collection such as List<Observer>?

2
  • I guess it's just because it's an old code. Generics came in 1.6. Commented Jan 22, 2013 at 0:09
  • @JanDvorak 1.5 (before even C# had them). Commented Jan 22, 2013 at 1:18

1 Answer 1

8

It's a very old class, dating back to JDK 1.0. At the time, there was no List.

Sign up to request clarification or add additional context in comments.

12 Comments

" dating back to JDK 1.0 " -- can you share your references?
The List interface (no generics) was added in 1.2
@Chan You're avoiding Observable because it internally uses a class you don't like?
@fazhool List is an interface
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.