• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to create a dynamic array using Java version 1.2  RSS feed

 
Drew Goldberg
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

At my internship, due to some constraints, we must use Java 1.2 because our application has to be backwards compatible with J#. Therefore I cannot use the java.util.Collections library. Is there a simple way of creating a dynamic array of objects in Java version 1.2.


Cheers,

Drew
 
Rob Spoor
Sheriff
Posts: 20898
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The collections framework exists since Java 1.2, so I don't see why you can't use a simple List / ArrayList.
 
Drew Goldberg
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the feed back.

Bear with me here because I am new at this, the problem I have with using an ArrayList<> is that the IDE says that the "Generics are not supported at this language level"


Bummer.


Cheers,

Drew
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Generics came later (1.5), just use it without the generic notation.

Bill
 
Drew Goldberg
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Many Thanks!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!