SCJP 1.4
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
SCJP 1.4
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
SCJP 1.4
All things are lawful, but not all things are profitable.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
SCJP 1.4
ia[0] | ia[1] | ... |
---|---|---|
int[] {...} | int[] {...} | ... |
ia[0] | ia[1] | ia[2] |
---|---|---|
int[] {1, 4} | int[] {3} | int[] {9, 8, 7} |
Liutauras Vilda wrote:
5. What you have in place of something? Well, no more pairs of [], you have defined data type int, so ints are there:
int[][] A = new int[2][3];
{{1, 2, 3}, {1, 2, 3}}
Junilu Lacar wrote:However, if you try to access ia[0][2], you'll get an IndexOutOfBoundsException because the array ia[0] only has 2 elements
Urs Waefler wrote:
The term dimension in Java is abstract. I do not have any problems with this term. What I do not fully understand is the numbering.
Let me try to make it more clear: Initially there is: But it is not like that: My problem has more to do with the syntax, the notation.
Liutauras Vilda wrote:Junilu is quite pedantic from what I have observed. Which is a feature I like a lot t. I am too.
William Ng wrote:
You are making this more complicated than it is. The variable ia is already an array. So it's type is an array type. It does not make since ot have to say ai[].length. Because in java and most langagues, the [] is the method of accessing elements in the array. What would you be accessing with a[0].length? You would be acessing the first element which is an array,as specified in the declaration.
SCJP 1.4
Urs Waefler wrote: It fails to compile.
It will give me the powers of the gods. Not bad for a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|