Shortest or longest

  • 10
  • Locked
Java games with lists are very popular. This makes sense, since they are all so simple and interesting. Join in the fun! In this task, we create a list of strings. Then we add 10 strings from the keyboard. The most interesting part is that we'll determine whether the shortest string or the longest string is encountered first in the list. If more than one string is shortest or longest, we'll consider the very first one we encounter.
You can't complete this task, because you're not signed in.
Comments(10)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Clarendon leeLevel 8 , Baltimore
Friday, 02:10
I think,this task makes some mistake! For example, I try several times, when I just use " if ( max== list.get(I).length())" it can output "grandfather " ! But when just use " if( min== list.get(I).length())" it can't output anything at all ! This task is wrong at all. ,!!!
AlexLevel 41
Friday, 07:23
Please submit a question with your code in the Help section.
DincaLevel 10 , Giurgiu
23 October 2019, 16:56
I compiled the code and the answer is correct why it does not pass the test?
RomanLevel 41
24 October 2019, 05:48
If you need help, something isn't right in your code, the server won't accept your solution (even if you are 100% sure that it is correct). Describe your question/issue in the HELP section at codegym.cc/help.
AlexandrLevel 9 , Boryspil'
11 September 2019, 19:18
Please me help!:) Why does not pass the test???
RomanLevel 41
24 October 2019, 05:47
If you need help, something isn't right in your code, the server won't accept your solution (even if you are 100% sure that it is correct). Describe your question/issue in the HELP section at codegym.cc/help.
KIN SOCHEATLevel 19 , Phnom Penh
29 May 2019, 03:27
my code some out correct but the result give wrong. Someone can help please
An GeloLevel 18 , Cebu
18 August 2018, 14:40
Hi can someone give me an example of the output. I'm having a hard time to analyze. thank you :)
RomanLevel 41
20 August 2018, 08:19
For example:
one1
two
three
four
five
six
seven
eight
nine
ten
the longest: three, seven, eight the shortest: two, six, ten You should display "two", because this string occurs earlier in the list from the shortest or the longest strings.
Rakesh KumarLevel 16 , Gambat
28 June 2019, 16:14
Thank you very much, this hint is very useful.