(2) Write a program to store 10 elements through user input and sum the array of elements in to a word
import java.io.*;
public class Task9
{
public static void main(String[] args) throws IOException
{
& // Preparing the stream
& BufferedReader bReader = new BufferedReader(new InputStreamReader(System.in));
& // reading the elements inputed by user
& String[] elements = new String[10];
& for (int i = 0; i < 10; i++)
& {
& System.out.print("Enter the element (string of the symbols): ");
& elements[i] = bReader.readLine();
& }
& // Summing the elements into a word:
& String word = new String();
& for (int i = 0; i < 10; i++)
& word += elements[i];
& System.out.print("\n\nThe sum of the array elements:\n" + word);
}
}