Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6010739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:09:36+00:00 2026-05-23T02:09:36+00:00

I have to use Java 1.4 and am using arraylist structures. Now I need

  • 0

I have to use Java 1.4 and am using arraylist structures. Now I need to do some re-factoring and it would help if I can use Generics. Currently I have code like this

ArrayList rows = new ArrayList();

Which is a straightforward ArrayList. But now the “rows” variable is becoming more complex and need to define a “Row” class. I now want to do something like what you see in J2SE 1.5

ArrayList<Row> rows = new ArrayList();

A trawl through Google doesn’t expose any answers without some sophisticated use of 3rd party solutions. How would my code have to change to accommodate this in 1.4, without using 3rd party solutions/open source projects, (if possible)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T02:09:37+00:00Added an answer on May 23, 2026 at 2:09 am

    Generics were introduced in JDK 1.5. So you can’t use them in 1.4. However, you may be able to use JDK 1.5 compiler but target 1.4 with your classes with -target 1.4 javac option while keeping -source 1.5 option to indicate that your source is 1.5 compatible. In this case you can use generics as they should not affect result classes.

    See the section on Cross-Compilation Options

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some data structures, and I would like to use one as a
I've just started using Java's enums in my own projects (I have to use
What java GUI layout manager does everyone use? Lately, I have been using MigLayout
I have a Perl module that I would like to use from Java. Is
I'm still trying to get my head around using Java's generics. I have no
I have a project for school and I have to use Java. Recently I
I'm converting an application to use Java 1.5 and have found the following method:
I have a set of source folders. I use a Java class to build
I am creating one GUI in swing Java. I have to use one button
We have a few processes in Java that use nanoTime for internal benchmarking (since

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.