Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / April 2004

Tip: Looking for answers? Try searching our database.

Java and Dynamic arrays

Thread view: 
Poochie - 17 Apr 2004 22:23 GMT
Hi all,

I'm currently developing an application in Delphi that in a few months I'll
need to port Java, witch I'm about to start studying, so I needed to know
if Java supports dynamic arrays.

Thanks, Poochie
Christophe Vanfleteren - 17 Apr 2004 22:32 GMT
> Hi all,
>
[quoted text clipped - 3 lines]
>
> Thanks, Poochie

Java only has fixed size arrays.

There is a very powerfull Collections framework that offers lots of handy
datastructures though:
http://java.sun.com/docs/books/tutorial/collections/index.html

Signature

Kind regards,
Christophe Vanfleteren

Roedy Green - 18 Apr 2004 00:19 GMT
>I'm currently developing an application in Delphi that in a few months I'll
>need to port Java, witch I'm about to start studying, so I needed to know
>if Java supports dynamic arrays.

Java lets you allocate arrays of any size determined at runtime, but
they are fixed.  To grow you must allocate a new array and copy, like
C.  Java also has the Vector collection that is like an array that
grows automatically as needed.  There are many other Collections that
come built-in.  In Java 1.5 Vectors can contain specific object types.
Before that, the contents are considered generic objects, and it up to
you when you fish them out to manually cast them back to what they
really are.

See http://mindprod.com/jgloss/collection.html

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Bryce (Work) - 19 Apr 2004 14:26 GMT
>Hi all,
>
>I'm currently developing an application in Delphi that in a few months I'll
>need to port Java, witch I'm about to start studying, so I needed to know
>if Java supports dynamic arrays.

Vectors..

A whole Collections API.

--
now with more cowbell
Stefan Waldmann - 20 Apr 2004 10:57 GMT
>>Hi all,
>>
[quoted text clipped - 5 lines]
>
> A whole Collections API.

Hi,

or ArrayList instead of Vector, if you don't have to use it in
multithreaded environment. ArrayList is unsynchronized and therefore
more performant than Vector.

Regards,
Stefan


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.