> > One of my applets was specifically written to Java 1.1 standards to
> > avoid the need for the plug-in. Is this going to break now that 1.5 is
[quoted text clipped - 4 lines]
>
> John
I'm not worried about that, as much as I'm worried about my existing
Java 1.1 bytecode running in the 1.5 JVM which apparently doesn't have
the older version of the Vector class. I wrote the applet several
years ago when IE came with its own JVM. The applet is educational,
and many schools are still using out-of-date hardware with older
operating systems like Win98, and the older browsers that come with
them. Of course, there are also some, like mine, that have up-to-date
hardware and software. So I also need the applet to work on those
machines too.
BTW, I've probably confused people by switching questions in
mid-thread. I wasn't thinking of this applet when I first asked the
question. But the answer to my original question led to this concern.
Also, even though I'm not planning on working on this particular
applet, I may create a new one and will want to reuse some of the
components from the old one and keep it written to Java 1.1 standards.
FWIW, it appears that the older version would be Vector<Object> in the
new system. Maybe Vector and Vector<Object> are treated as the same
thing by the JVM.
Hendrik Maryns - 06 Jul 2006 08:47 GMT
Redbeard schreef:
> FWIW, it appears that the older version would be Vector<Object> in the
> new system. Maybe Vector and Vector<Object> are treated as the same
> thing by the JVM.
Not entirely, but you can still simply use Vector without any generic
argument and ignore the warnings, if you want.
(If I really needed a Vector<Object>, I would rethink my design)
H.
- --
Hendrik Maryns
==================
http://aouw.org
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
Oliver Wong - 06 Jul 2006 15:35 GMT
>> > One of my applets was specifically written to Java 1.1 standards to
>> > avoid the need for the plug-in. Is this going to break now that 1.5 is
[quoted text clipped - 13 lines]
> hardware and software. So I also need the applet to work on those
> machines too.
IE's JVM is a special case, because it doesn't actually implement the
Java Standard. Basically, if you use MSJVM, all bets are off.
So ignoring MSJVM for now, 1.1 code should, for the most part, work with
1.5. In particular, if you don't use generics, your code will still run
fine. The generics information is only for compile time checking, and that
information doesn't even appear in the class files (google for Java Type
Erasure for more details).
The only thing is you'll get warnings with a 1.5 compiler. They're
trying to encourage you to use generics. But you can ignore those warnings
(or disable them completely).
> FWIW, it appears that the older version would be Vector<Object> in the
> new system. Maybe Vector and Vector<Object> are treated as the same
> thing by the JVM.
There was a discussion a while ago; not sure if it's this newsgroup or
comp.lang.java.programmer, but the conclusion was that Vector, Vector<?> and
Vector<Object> are not exactly interchangeable, in some obscure corner
cases. If you want to use the "old" Vector, just use Vector (without any
type qualifiers), and live with the warning until you understand generics
better. It's better than putting in the wrong type qualifier and then
getting strange compile errors that you can't untangle.
- Oliver
Daniel Dyer - 06 Jul 2006 15:41 GMT
>> FWIW, it appears that the older version would be Vector<Object> in the
>> new system. Maybe Vector and Vector<Object> are treated as the same
[quoted text clipped - 8 lines]
> type qualifier and then getting strange compile errors that you can't
> untangle.
If you want to target 1.1 you will have to omit the type qualifier beause
you can't set the compiler target to 1.1 and the source verion to 1.5 with
javac.
Dan.

Signature
Daniel Dyer
http://www.dandyer.co.uk