Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

about Arrays  RSS feed

 
sharma anurag
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
to all my friends of javaranch.!
Somebody is thier who explain me the concept of array,and multi-dimensional array .!! please explain in very simple manner with example.!!!
Thanks in advance.!!
 
Manuel Leiria
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here you go

http://java.sun.com/docs/books/tutorial/java/nutsandbolts/arrays.html

I took me 5 seconds on google
 
Sylven Yip
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
an array contants a series of variables of same kind or objects of the same class.
you can visit any variable just use the array name and index.
e.g.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12542
48
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
an array is like an egg carton. it holds a bunch of thing that are all alike - chicken eggs.

a 2 dimensional array is like a crate of egg cartons. it holds a bunch of things (egg cartons) that hold thing (chicken eggs).

a 3 dimensional array would be like a palate in the back of a truck. it holds things (egg carton crates) that hold things (egg cartons) that hold things (eggs).

a 4d would be the truck with many palattes.

a 5d would be the fleet of trucks...
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To use an analogy, an array is like a filing cabinet. The number of drawers -- along with what you're allowed to put in the drawers -- is set when the cabinet is built and cannot be changed.

In Java, a multi-dimensional array is just a filing cabinet where each drawer contains another filing cabinet.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whoa... I see Fred and I are thinking along the same lines.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!