aspose file tools*
The moose likes Java in General and the fly likes How to create a dynamic array using Java version 1.2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to create a dynamic array using Java version 1.2" Watch "How to create a dynamic array using Java version 1.2" New topic
Author

How to create a dynamic array using Java version 1.2

Drew Goldberg
Greenhorn

Joined: Sep 11, 2011
Posts: 12
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

Joined: Oct 27, 2005
Posts: 19670
    
  18

The collections framework exists since Java 1.2, so I don't see why you can't use a simple List / ArrayList.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Drew Goldberg
Greenhorn

Joined: Sep 11, 2011
Posts: 12
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

Joined: Mar 22, 2000
Posts: 12769
    
    5
Generics came later (1.5), just use it without the generic notation.

Bill
Drew Goldberg
Greenhorn

Joined: Sep 11, 2011
Posts: 12
Many Thanks!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to create a dynamic array using Java version 1.2