# A Part Question

• April 12th, 2011, 12:49 PM
Aksand
A Part Question
Hi,

I have a Homework that say build 2D array with 4 rows and different columns
like this E.g
1 2 3
1 2 3 4
1 2
1 2 3 4 5

then sum of each row and columns

i have made the program , the sum of rows works good , but in columns i am facing a problem which is the length .
So my question is How to Defeat this problem

and thanks.
• April 12th, 2011, 01:01 PM
KevinWorkman
Re: A Part Question
Hint: A 2D array is just an array of arrays.
• April 12th, 2011, 11:34 PM
Aksand
Re: A Part Question
Ooooops , i Have forget something...
it is not normal sum, the question asks by using loop.....

Thanks KevinWorkman.
I am still Beginner in Java...
• April 13th, 2011, 07:44 AM
KevinWorkman
Re: A Part Question
Quote:

Originally Posted by Aksand
Ooooops , i Have forget something...
it is not normal sum, the question asks by using loop.....

Thanks KevinWorkman.
I am still Beginner in Java...

So are you still stuck, or did you figure it out?
• April 13th, 2011, 10:33 AM
Aksand
Re: A Part Question
aaaaaaa,nup

i am still having an Error in the sum of each columns , the whole problem is the length of each column while using for loop.
• April 13th, 2011, 11:12 AM
Aksand
Re: A Part Question
Quote:

Originally Posted by KevinWorkman
So are you still stuck, or did you figure it out?

Oooo Thanks A lot KevinWorkman.
It is Works like Charm now , just one if statement solved the problem..
I am missing C days , when I was stay weeks in one problem...

Is there a "Solved" button , so i can consider this as solved???