• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

1D 2D array variables

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
also coming stuck with these. ive ordered your book and shouldnt have any further problems once that's arrived (he wishes!)
what are 1d and 2d array variables?
 
author and iconoclast
Posts: 24203
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A one dimensional (1d) array is like a list of items:

A two dimensional (2d) array is like a rectangular matrix of items:

You get can an element of a 1d array with one subscript: list[2] is the int "12" (we count from 0 in Java). But you need two subscripts to get an element of a 2d array: matrix[2][1] is the int "9". 2 is the row number, and 1 is the column number. Make sense?
 
James Matthews
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes both my queries are cleared up, thanks a lot.
hopefully ill start to understand it all better soon
 
reply
    Bookmark Topic Watch Topic
  • New Topic