Java Lists/ 7. Order by Age
https://pastebin.com/C91DdzSR
Някъде имам грешка, която не виждам.
You will receive an unknown number of lines. On each line, you will receive an array with 3 elements. The first element will be string and represents the name of the person. The second element will be a string and will represent the ID of the person. The last element will be an integer which represents the age of the person.
When you receive the command "End", stop taking input and print all the people, ordered by age.
Examples
Georgi 123456 20
Pesho 78911 15
Stefan 524244 10
End
Stefan with ID: 524244 is 10 years old.
Pesho with ID: 78911 is 15 years old.
Georgi with ID: 123456 is 20 years old.
Мерси, но все още ми дава следната грешка:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
at Exercise1002.Exercise1002.main(Exercise1002.java:53)
Дава ми същата грешка и на друга подобна задача.
С промяната на колежката дава 100/100
На 50 ред не трябва да четеш tokens от конзолата. Трябва да е равен на input.split("\\s+").