Can do 1 string, but 10 strings is getting very difficult. Loops aren't helping as char[] cannot be dereferenced or char[] cannot be assigned to char[] and all other errors coming!
package com.codegym.task.task07.task0702;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/*
String array in reverse order
1. Create an array of 10 strings.
2. Enter 8 strings from the keyboard and save them in the array.
3. Display the contents of the entire array (10 elements),
on the screen in reverse order. Each element on a new line.
*/
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
char[] try1 = new char[100];
String[] str = new String[10];
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
for(int i = 0; i < 10; i++)
str[i] = reader.readLine();
//for(int i = 0; i < 10; i++)
//try1[i] = str[i].toCharArray();
try1 = str[1].toCharArray();
for (int i = try1.length - 1; i>=0; i--)
System.out.print(try1[i]);
/*
for (int i = try1.length-1; i>=0; i--)
System.out.print(try1[i]);
Works perfectly for 1 String
*/
//System.out.println((set[1].charAt(1))); Getting 1st char of 1st array
/*for(int i = 0; i < 10; i++)
System.out.println(set[i]);
Print all elements of the array */
}
}