//
import java.io.*;
import java.lang.reflect.*;
import java.util.*;
public class ClassTemplate1 {
public String str1; private String str2; public ClassTemplate1() {
// TODO Auto-generated constructor stub
str2="encapsulated strictly Private scope";
System.out.println(str2);
}
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
String[] array1 = {"ABC" ,"ACD", "AEF", "AFG","ADE"};
try{
System.out.println(" Unsorted array objects---");
ArrayList<String> str1 =new ArrayList<String>(Arrays.asList(array1));
//calling static class directly with class name
Process.display1(str1);
//filling ArrayList with array
Arrays.sort(array1);
List<String>alist = new ArrayList<String>(Arrays.asList(array1));
System.out.println("Printing sorted List as a block");
System.out.print(alist);System.out.println();
//send to a loop
System.out.println("Iterate sorted List with For loop");
Process.display2(alist);//
}catch(NumberFormatException e){
//
}
}}
//Reference super class
class Process{
Process() {} // constructor
public static void display1(ArrayList<String> str1 ){
for(String stx :
str1)
{
System.out.println("\t"+
stx + " array of "+ str1.toString());
}
}
public static void display2(List<String> str1 ){
for(String stx :
str1)
{
System.out.print("\t"+
stx );
}
}}