+ 1
How can I print the highest number in one array or in one list? Java
Example Int[] ={0,4,8,3}; Print 8
9 Antworten
+ 15
https://www.sololearn.com/Discuss/316152/?ref=app
//first try yourself ... U'll make yourself easily [without using Arrays.sort ()]
+ 6
//import java.util.*;
int i[] = {0,4,8,3};
Arrays.sort(i);
System.out.println(i[i.length-1]);
+ 5
you could sort array and use last element. The length() method is very useful for doing this
+ 4
@mateo please explain what you want you would like to do there will be someone who can help ☺.
Also array and array lists are diffrent the example i shown was using array, with array lists there one dimensional and you can remove elements.
+ 3
The thing is that I don't know what will put the uswr
+ 2
I am not going to give you code but some hints.
1> You should iterate through array ( use for loop )
2> you need temporary variable to store current maximum number
3> you need if statement comparing current temporary maximum with element in array
+ 1
The sort is just 4 lists
0
The sort is just 4 lists