i don't know but it still doesn't make any sense, according to my knowledge
you are assigning the first element of the first row and the last element of
the second row, and the loop doesn't work i tried this before. what do you
think about this miga.

Abbas Zaini.

On Sat, Jul 18, 2009 at 1:32 AM, fabian david camargo amaya <
[email protected]> wrote:

> //String are not arrays of characters
> //Code not proved but i guess it works if don`t sorry
> String strArray2D[][] = new String[2][2];
>
> strArray2D[0][0] = "Queen";//initialice the first elemnt
> strArray2D[1][1] = "King";//initialice the last element
>
> for (int rows = 0; rows < strArray2D.length ;rows++ ){
>      for (int cols = 0; cols < strArray2D[rows].length ; cols++ ){
>                  strArray2D[rows][cols] = "The row is" + row + "The col is"
> + cols;
>                   System.out.println(strArray2D[rows][cols]);
>             }//end of for cols
>  }//end of rows for
>
> 2009/7/17 Abbas Zaini <[email protected]>
>
>> well dear the information which we get from the course (specifically the
>> array lesson) is not covering the ways to access and process the contents of
>> a two dimensional String array. i have some experience in C++ and thing in
>> java are not done the same way, as an example the java array homework or lab
>> 1036 suggests you a code to modify so it outcomes the required result, the
>> home work is to find the longest first name of three names which are entered
>> throw keyboard. even this code makes three one dimensional array instead of
>> a three rows two dimensional array which we should access with loops, when
>> you try to apply these access methods to a predefined 2D string array, it
>> fails and the program gets full of errors.
>> in an other word how if i want to count the number of times the letter 'a'
>> occurred in the entries ( the two dimensional or even single dimensional
>> array of String).
>>
>> sorry for any inconvenience.
>>
>> >>
>>
>

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to