Как сделать shor равной первой строке?
Я пробывал:
all = text.get(0);
shor = all.length();
package com.javarush.task.task07.task0709;
/*
Выражаемся покороче
*/
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) throws Exception {
//напишите тут ваш код
ArrayList<String> text = new ArrayList<>();
int shor = 0;
String all = null;
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
for (int a = 0; a < 5; a++) {
String small = reader.readLine();
text.add(small);
shor = small.length();
if (small.length() < shor) {
all = text.get(0, small);
}
}
shor = all.length();
ArrayList<String> minimum = new ArrayList<>();
for (int a = 0; a < 5; a++) {
if (text.get(a).length() == shor) {
minimum.add(text.get(a));
}
}
for (String victory : minimum) {
System.out.println(victory);
}
}
}