What is the problem with this following declaration in JDK 1.4?
Hi,
My application requires me to declare the following line..
Hashtable<String, ArrayList> GraphMap = new Hashtable<String, ArrayList>();
This line in not running if I run it in Jdk 1.4 (on a remote server)
It is giving me the following errors:
research% javac LBLGraphPrep.java
LBLGraphPrep.java:45: not a statement
Hashtable<String, ArrayList> GraphMap = new Hashtable<String, ArrayList>();
^
LBLGraphPrep.java:45: ';' expected
Hashtable<String, ArrayList> GraphMap = new Hashtable<String, ArrayList>();
^
LBLGraphPrep.java:77: cannot resolve symbol
symbol : variable GraphMap
location: class LBLGraphPrep
if (GraphMap.containsKey(tokens[1])) {
^
.....
However, it is running on higher versions (my laptop has NetBeans and higher version of JDK, it is running there fine). I need to run this on this server because my application is memory intensive, and my personal computer does not support that.
Please help. What should I do?
thanks in advance.
-S
Re: What is the problem with this following declaration in JDK 1.4?
Please do not post the same question in multiple sub-forums. Your duplicate post has been deleted.
Java 1.4 doesn't support generics.
Re: What is the problem with this following declaration in JDK 1.4?
Java 5 only added the support for Generics.