I'm still a little bit confused on what your method maxSum is really doing. can you explain what does that method can do?
and please explain what each statement doing. you can put a comment. because...
Type: Posts; User: dicdic
I'm still a little bit confused on what your method maxSum is really doing. can you explain what does that method can do?
and please explain what each statement doing. you can put a comment. because...
why you cannot change that? Actually that is the reason why you got a wrong sum. And there is also one nonsense statement i=j+1;, that statement is completely nonsense. you just equated i to j + 1...
that is because of your conditional statement in public static int maxSum(int [] a) try to remove them and just put a max_sum += the array element. that should do it
7 in your code? how come that it should be 7? I'm sorry, I'm a little bit confused on your requirements
so if I input 1,2,3,-4,5,-6 the result is 1? is it right?
lets talk about your method public static int maxSum(int [] a)
can you explain what is that doing? a comment maybe.
As what I understand with your problem, you want to get the sum of your integer...