CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9

Threaded View

  1. #4
    Join Date
    Sep 2009
    Posts
    45

    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
  •  





Click Here to Expand Forum to Full Width

Featured