Results 1 to 3 of 3
Thread: Returning Array Row
- 04-14-2011, 09:30 PM #1
Member
- Join Date
- Apr 2011
- Posts
- 2
- Rep Power
- 0
Returning Array Row
I'm doing a Java assignment in which I make a method that reads in a 2d Array of int's in the header as well as a integer as to which row to print"public static int[] getRow(int[][] myArr2D, int rowNum)" I am to print the specific row that corresponds with that Int, so if the values for the 2d Array where,
{7, -13, 22, 123},
{5, 9, 0, -17},
{44, 1, 22, 66},
{12, 13, 14, 22};
and the int rowNum was 3, it would return 44,1,22,66. I have been reading all over the web and cant seem to find any tutorials for this type of thing, I also have to do it the opposite way, Printing a column in another method, So if the colNum was 2 it would print -13,9,1,13 Any help would be great. Thank you
**Edit** Also i forgot to mention that the row im returning has to be a new 1d array.Last edited by Zocheyado; 04-14-2011 at 09:34 PM.
- 04-15-2011, 02:14 AM #2
- 04-15-2011, 03:23 AM #3
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,068
- Blog Entries
- 3
- Rep Power
- 13
Similar Threads
-
returning double array
By Billaguana in forum New To JavaReplies: 2Last Post: 01-16-2011, 04:59 AM -
returning array
By aizen92 in forum New To JavaReplies: 4Last Post: 01-08-2011, 04:10 PM -
Returning HexaDecimal Values to an Array???
By stylishkishore in forum Advanced JavaReplies: 5Last Post: 12-18-2009, 09:04 AM -
Returning An Array
By elektronika in forum New To JavaReplies: 2Last Post: 12-07-2009, 04:43 PM -
Returning array problem.
By Chase in forum New To JavaReplies: 4Last Post: 10-21-2008, 10:07 PM
Bookmarks