But when I try to return the array, it gives me a weird reference that this is what is back : The array is: [I @ 895684] I do not know why this is not working, I am also unsure that Sir [1], a [2], a [3] ... an [N-1]
Import java.util. *; Class SumArray {public static zero main (string [] args) {scanner input = new scanner (System.in); System.out.println ("Enter some numbers (all on one line, separated by commas):"); String line = input NXtine (); String [] numbers = line.split (","); Int [] array = new int [numbers.length]; For (int i = 0; i & lt; array.label; i ++) array [i] = integer. Parsient (number [i] .tem ()); Int [] highSum = highest (array); System.out.println ("array is:" + topmost); } Public stable int [] highest (int [] a) {// int [] array = new int [a.length]; // int end = a.length - 1; Int sum = 0; Int [] highest = new int [a.length-1]; For {int j = 0; j and lt; a. Lanti-1; j ++} {for (int i = 0; i & lt; a long; i ++) {sum = sum + a [ I]; System.out.println (amount + "+ a.length);} highest [h] = sum; println (highestSum [j]);} highest return;} << Code>
this
int [] highSum = highestSum (array); System.out.println ("The array is: "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++> Hice);
To print the content.
Comments
Post a Comment