This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I am writing a program that converts an array of string values to text in an xml format. I need a method that takes the value in the first row and column of the array, places it in the desired xml text, and then does the same with the value in the same row, but next column. When the first row has been complete, the same process would be completed on the second row. This brings me to my question: Is it possible to call the element of an array based on the value of int variables? For example: I have an array of string values named testArray. I have two variables, rowCounter and columnCounter that I can manipulate to define the location of the element in testArray that I wish to call. I have a third variable, valueHolder, that I want to hold the vale of the array element I call. Instead of "string valueHolder = string testArray " could I use "string valueHolder = string testArray [rowCounter][columnCounter]"? Thanks for any info, and I'm open to other suggestions that may get this to waork. Landon
C:\>java -cp . Test this element contains 0 and 0 this element contains 1 and 0 this element contains 2 and 0 this element contains 3 and 0 this element contains 0 and 1 this element contains 1 and 1 this element contains 2 and 1 this element contains 3 and 1
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors