package com.codegym.task.task07.task0707;
import java.util.ArrayList;
/*
What sort of list is that?
*/
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
ArrayList<String> list = new ArrayList<String>();
list.add("s1");
list.add("s2");
list.add("s3");
list.add( "s4");
list.add( "s5");
System.out.println(list.size());
for (int i = 0; i < list.size(); i++)
{
int j = list.size() - i - 1;
System.out.println( list.get(j) );
}
}
}
package com.codegym.task.task07.task0707;
import java.util.ArrayList;
/*
What sort of list is that?
*/
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
ArrayList<String> list = new ArrayList<String>();
list.add("s1");
list.add("s2");
list.add("s3");
list.add( "s4");
list.add( "s5");
System.out.println(list.size());
for (int i = 0; i < list.size(); i++)
{
int j = list.size() - i - 1;
System.out.println( list.get(j) );
}
}
}