|
-
March 24th, 2010, 07:21 PM
#4
Re: Theory questions about Java
Thanks to both of you. But, I just have another question (which I got when read what dlorde said (or you - depending on who's reading this)): how can the length of the 2nd dimension of an array vary?
Here is an example I made for myself and no matter the integer value of the "index" variable, the length is always the same:
Code:
public class temp
{
public static void main(String[] args)
{
char[][] array = new char[5][10];
for(int index = 0; index < array.length; index++)
int theLength = array[index].length;
System.out.println(theLength);
}
}
Last edited by s3a; March 24th, 2010 at 07:37 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|