| Author |
Dim of Array
|
Girish Pandey
Greenhorn
Joined: Mar 29, 2007
Posts: 1
|
|
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
Joined: Jul 08, 2003
Posts: 24057
|
|
|
Moving to SCJD; can't imagine there's any other purpose for asking this.
|
[Jess in Action][AskingGoodQuestions]
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32675
|
|
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
Joined: Oct 13, 2005
Posts: 32675
|
|
You might find more in the JVM specification. Try section 4.10. Then tell everybody what you found.
|
 |
Pravin Jain
Ranch Hand
Joined: May 20, 2007
Posts: 60
|
|
|
The maximum number of dimensions can be upto 255.
|
The Zen of Java Programming.
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32675
|
|
|
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
Joined: Aug 03, 2002
Posts: 7729
|
|
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.
|
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
|
 |
 |
|
|
subject: Dim of Array
|
|
|