# java does not limit the number of dimensions that an array may have.

118 views

## Problem :

java does not limit the number of dimensions that an array may have

## Solution :

The Java language does not limit the number of dimensions in an array but the Java VM spec limits the number of dimensions in an array to 255.

For example, the following code will fail to compile

class Main {
public static void main(String[] args) {
final int[][][][][][][][][][][][][][][][]
[][][][][][][][][][][][][][][][]
[][][][][][][][][][][][][][][][]
[][][][][][][][][][][][][][][][]
[][][][][][][][][][][][][][][][]
[][][][][][][][][][][][][][][][]
[][][][][][][][][][][][][][][][]
[][][][][][][][][][][][][][][][]
[][][][][][][][][][][][][][][][]
[][][][][][][][][][][][][][][][]
[][][][][][][][][][][][][][][][]
[][][][][][][][][][][][][][][][]
[][][][][][][][][][][][][][][][]
[][][][][][][][][][][][][][][][]
[][][][][][][][][][][][][][][][]
[][][][][][][][][][][][][][][][] x;
}
}
with error

1.java:18: error: array type has too many dimensions
[][][][][][][][][][][][][][][][] x;
^
1 error

## Related questions

6 views
Problem: can someone please help for this problem? java limits the number of dimensions that an array may have to 15.
1 vote
608 views
Problem : I am beginner to numpy. I am trying to execute my code but I am facing below error. &ldquo;Valueerror: all the input arrays must have same number of dimensions&rdquo;. I want to have my all the arrays with a same shape. I am trying to fix above error from past couple of days but still unable to fix it. I am looking for some help in fixing above error.
2 views
Problem: I'm trying to solve this exercise of finding the number that appears an odd number of times in an array. I have this so far but the output ends up being an integer that appears an even number of times. For example, the number 2 appears 3 times and the number 4 appears 6 times, but the ... count = tempCount; element = array[j]; } } } } return element; } oddInt([1,2,2,2,4,4,4,4,4,4,5,5]);
34 views
Problem: Please assist me in resolving this issue: find a pair of elements from an array whose sum equals a given number in java
127 views
1 vote
9 views
Problem: I need a Java expert who could help ,me with this: Java program to find largest and smallest number in an array.
5 views
Problem: I will request someone to answer how to find the Java program minimum and maximum number in an array?
1 vote