Results 1 to 5 of 5

Thread: Java Hashmaps in jdk 1.4

  1. #1
    Join Date
    Apr 2010
    Posts
    223

    Java Hashmaps in jdk 1.4

    Hi everyone, I am trying to work out on a old released jdk 1.5 code for hashmap to be converted to jdk 1.4,
    Code:
    public HashMap<String, String> getDLinkUrls() throws SQLException {
    HashMap<String, String> hashMapValues = new HashMap<String, String>();
    My code also looks like the above suggested code ... I am receiving an error message , says that invalid method declaration and return type required.. Please help me with some suggestion in conversion of my code to jdk 1.4...

    Thanks ..

  2. #2
    Join Date
    Oct 2005
    Posts
    924

    Re: Java Hashmaps in jdk 1.4

    I am not getting properly what you actually wanted to do ? You are trying to compile that code with the 1.4 compiler? Remove out the generics. That is commonly the largest difference between the two different versions, the thing you are going to give most of your time removing.

    Actually, the generics were suggested in 1.5. resolving the type of parameterizations issues such as <String, String>. However, why you are going to convert the .5 code to go with the 1.4 which seems as the mystery for me. And you are likely to run into big issues than this trivial one.

  3. #3
    Join Date
    Apr 2010
    Posts
    223

    Re: Java Hashmaps in jdk 1.4

    Thank you very much for this very suggestion , I have been facilitated with pre installed 1.5 in JDeveloper 10g on my client, I have started the coding, though with some complexity with the same 1.5 J2SE version. Currently , when I have completed with my application and made a WAR file for deployment, I was stated that the previously implemented Oracle application server is supporting 1.4 version and I require to convert my code within the 1.4.

    I am clueless what I have to perform now .. Could you please let me know how to destroy the generics specified ?

  4. #4
    Join Date
    Sep 2005
    Posts
    1,434

    Re: Java Hashmaps in jdk 1.4

    Yeah ! why not.. you can do it very easily . I am posting the code below and I am sure it will help you remove the generic .


    Code:
    List<String> list = new ArrayList<String>();
    ...
    for (String st : list) {
    
    }
     
     List list = new ArrayList();
    ...
    for (Iterator iter = list.iterator(); iter.hasNext();) {
      String st = (String)iter.next();
    
    }

  5. #5
    nealrelics Guest

    Re: Java Hashmaps in jdk 1.4

    It seems that I have been very careful with the source code and a few errors crept please take a look at the files in a revised version.

Similar Threads

  1. Replies: 4
    Last Post: 04-09-2013, 11:04 PM
  2. Setting Of Java to The Point At Manual Java
    By winni in forum Software Development
    Replies: 4
    Last Post: 10-01-2011, 10:05 PM
  3. Java Programming using Adventnet SNMP Java API
    By ROCKING_Suhas in forum Software Development
    Replies: 5
    Last Post: 17-07-2010, 06:52 AM
  4. Link List Example in Java Sample program in Java
    By trickson in forum Software Development
    Replies: 2
    Last Post: 04-08-2009, 08:23 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,704,123.30435 seconds with 17 queries