Jump to content

Java Print Error

Hey, Guys, I need help fixing the print of the list. I don't know why Java is printing it that way and I would love some feedback on this situation.

The code is supposed to find the sum of each row in a Grid List and make a list of the summed up rows into one list. 

Thanks for the feedback! :) 

programshit.PNG

Link to comment
Share on other sites

Link to post
Share on other sites

You are printing the reference to the object. Do something like:

int[] aux=rowSums(arr2D);
for(int i=0;i<aux.length;i++){
  System.out.println(aux[i]);
}

 

The best way to measure the quality of a piece of code is "Oh F*** "s per line

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×