When I compile my program, I'm not getting any errors but the output is just a bunch of red text. What do I have to change to get the middle 3 validation requirements?
package com.codegym.task.task07.task0727;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
/*
Changing functionality
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<String> list = new ArrayList<String>();
while (true) {
String s = reader.readLine();
if (s.isEmpty()) break;
list.add(s);
}
ArrayList<String> list1 = new ArrayList<String>();
String a = null;
for (int i = 0; i < list.size(); i++) {
String s = list.get(i);
if (s.length() % 2 == 0)
a = s + " " + s;
else
a= s + " " + s + " " + s;
}
for (int i = 0; i < list1.size(); i++) {
System.out.println(list1.get(i));
}
}
}