Skip to content
Advertisement

Display the highest score from an arrayList from a txt file

I’ve been trying to display the highest score from the URL file and have been able to display the entire score list but I cant get it to display the maximum or it throws an error. I was able to display the scores separately

JavaScript

but when I tried to add this to the if statmeny instead of the system.out.println(finalData[1]); It failed

JavaScript

Advertisement

Answer

finalData is Strig array, so you can iterate it by using String object only. You can use this code:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement