Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to create a dynamic array using Java version 1.2

 
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
Pie
Posts: 20608
63
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: 13071
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic