aspose file tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Dim of Array Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "Dim of Array" Watch "Dim of Array" New topic
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
    
  13

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
    
    4
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
    
    4
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
    
    4
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.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Dim of Array
 
Similar Threads
Doubt
How could I print names randomly?
WA #1.....word association
Another 'Y' game
about array