Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: What is the problem with this following declaration in JDK 1.4?

  1. #1
    Junior Member
    Join Date
    Aug 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 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


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default 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.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Junior Member
    Join Date
    Sep 2011
    Posts
    18
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: What is the problem with this following declaration in JDK 1.4?

    Java 5 only added the support for Generics.

Similar Threads

  1. [SOLVED] Constructor and declaration issues
    By Gthoma2 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: June 27th, 2011, 11:16 PM
  2. Variable declaration placement
    By 2nickpick in forum Java Theory & Questions
    Replies: 2
    Last Post: January 22nd, 2011, 11:34 AM
  3. Use variable in array declaration statement
    By thedolphin13 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: September 24th, 2010, 03:42 PM
  4. Very beginner - What's wrong in my applet declaration?
    By rforte in forum What's Wrong With My Code?
    Replies: 5
    Last Post: April 30th, 2010, 04:54 AM