Results 1 to 4 of 4

Thread: N00b Question

Threaded View

  1. #3
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    Ive never had the need so far to declare a mutli-demensional array for use with a file but as CaptainPinko pointed out it can be done as

    Code:
    type[]identifier = new type[]
    where type can either be a primative type or an object type.
    Same goes for a mutli-demensional or (two dimensional array)

    Code:
    type[][]identifier = new type[][]
    When declaring mutli-demensional arrays you must either specify row, or rows and cols. ie....... [4][] or [4][4]. Using [][4] would give you an error.

    Arrays are pretty easy to work with but the manner in which they can be declared and initialized can somtimes lead to confusion. For instance....
    Code:
    int[]x = {0,1,2,3,4};
    is the equivalent to
    Code:
    int[]x = new int[]{0,1,2,3,4};
    Anonymous arrays can also be created, Neither the name of the array nor the dimension of the array is specified.
    Code:
    new int[] {0,1,2,3,4}
    If you want to retrieve data from a file then your getting into I/O which consists of streams and such...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width