Click here to Skip to main content
15,500,977 members

Comments by Paulo Zemek (Top 89 by date)

Paulo Zemek 3-May-22 15:56pm View    
Ideally you should not have a setSumTotal. The getSumTotal should be doing a return dice1 + dice2;
Paulo Zemek 6-Aug-18 18:41pm View     CRLF
I think the problem is the dot in the class name: "DebtRatioSwing.Java" I believe it is expecting the { where the dot appears.
Paulo Zemek 1-May-18 19:29pm View     CRLF
I am not sure about dealing with excel, but when you delete a row, all other row indexes above that one will change. So, if you delete row 10, row 11 becomes 10, but your for is still going to check for row 11 (and worst, if the 11 was before the last row, now it is past-last). So, it will probably help to start from the end:
for (i = lastRow; i>=1; i--) { /* your code */ }
Paulo Zemek 24-Apr-18 17:06pm View     CRLF
Actually the Resize method always creates a new array. So it would be better to simply create a new array with Length-1, and then copy directly to the new array. Yet, using a List instead of an array is probably still the best option.
Paulo Zemek 24-Apr-18 17:05pm View     CRLF
You can't really remove items from an array. What you can do is create another array with less items and copy only the items you care about. Yet, as you used ToList().RemoveAt(0) in your try, why can't you simply have a list, instead of an array, so you can very easily add or remove items?