Re: Java and Dynamic arrays

From: Roedy Green (see_at_mindprod.com)
Date: 04/18/04


Date: Sat, 17 Apr 2004 23:19:51 GMT

On Sat, 17 Apr 2004 21:23:07 GMT, Poochie <poochie2NO_SPAM@libero.it>
wrote or quoted :

>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.


Relevant Pages

  • Re: seeking advice for "translate" Fortran code to Java code
    ... redefine a common block as needed for each subroutine. ... Still, Java has no pointers, so I ... Java arrays are always what C would call arrays of pointers ... Fortran intrinsics in Java appropriately. ...
    (comp.lang.fortran)
  • Re: seeking advice for "translate" Fortran code to Java code
    ... with these features that just don't exist in Java: ... Labeled COMMON blocks Blank COMMON ... Java arrays are always what C would call arrays of pointers ... FORTRAN I/O class that would emulate formatted and binary I/O. ...
    (comp.lang.fortran)
  • Re: Java und Effizienz
    ... Statt dessen sollte man nur Arrays und Schleifen verwenden ... Die meisten Parser (in Java) sind langsam weil die Leute Stringverarbeitung nicht im Griff haben. ... In Java musst du übrigens bedenken, dass alle Array-Zugriffe eine Indexprüfung beinhalten, sodass Zugriffe auf Arrays teurer sind als Zugriffe auf Exemplarvariablen von Objekten. ...
    (de.comp.lang.java)
  • Re: Java Generic programming using subclassing
    ... >> form into the standard Java syntax. ... >> derivative language that has multidimensional arrays where Java does not? ... the major high-level languages and should be allowed to use this terminology without ...
    (comp.lang.java.programmer)
  • Re: Using pointers in Java
    ... I was just saying to someone yesterday: "Java is not a replacement ... One alternative to your "arrays of one element" proposal would be to put ... void add{ ... > public class MutableDouble { ...
    (comp.lang.java)