Hello,

I'm getting a compile-time error in jdk1.2.1 which says "Identifier expected" and points to this line in the code:

Vector<Fish> fishes = new Vector<Fish>();

Aren't vectors supported in jdk1.2.1? I'm unable to catch the problem.

Recommended Answers

All 4 Replies

Hello,

I'm getting a compile-time error in jdk1.2.1 which says "Identifier expected" and points to this line in the code:

Vector<Fish> fishes = new Vector<Fish>();

Aren't vectors supported in jdk1.2.1? I'm unable to catch the problem.

Vectors may be supported in jdk, but they may not be supported with Generics.

Try--

Vector fishes = new Vector();

Or update your development kit to a more recent version.

Alex is correct. Generics became available with 1.5. And 1.2 is way too old to be using for anything these days.

It's also no longer supported, and I think not even Y2K compliant in places.
There is NO reason to use it.

I had 1.2 with me and hadn't come to learn any such advanced feature that wasn't supported by it. I'm still learning core java. I'll upgrade my kit for sure.

Thank you Alex Edwards :), the thing is working after the modification.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.