Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dim of Array

 
Girish Pandey
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Q.What is the maximum number of dimensions an array can accept:
(a). 266
(b). 255
(c). 256
(d). 250
& Why .
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to SCJD; can't imagine there's any other purpose for asking this.
 
Campbell Ritchie
Sheriff
Pie
Posts: 50277
80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An array can only accept a single dimension. Go through the Java Language Specification and look for section 10. There is no such thing as a multi-dimensional array in Java. And the same section will tell you the largest number of [] in arrays of arrays is 258.

There is a minor misprint in this posting. Find it yourself.
 
Campbell Ritchie
Sheriff
Pie
Posts: 50277
80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might find more in the JVM specification. Try section 4.10.

Then tell everybody what you found.
 
Pravin Jain
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The maximum number of dimensions can be upto 255.
 
Campbell Ritchie
Sheriff
Pie
Posts: 50277
80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please don't tell him the answer, Pravin Jain. I knew it's 255, you knew it's 255, now (he?) Giresh Pandey won't know how to find out things for himself, and will soon forget it's 255.
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ernest Friedman-Hill:
Moving to SCJD; can't imagine there's any other purpose for asking this.


It's not even a question that would be asked for SCJP 1.4/5.0 either.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic