Hi!
I am very young and very inquisitive!
I the beginning programmer.
My program
(Sorting alphabetically)
input file:
ccc
ddd
bbb
ddd
aaa

output file:
aaa
bbb
ccc
ddd
ddd


How to make so that in a target file there were no repetitions?
that was like this:
aaa
bbb
ccc
ddd


Help please!)
Code:
 
class Customer implements Comparable<Customer> {
  
	private String sequance;
   
   public Customer() {
	   sequance = "ppp";
	     }
   
   public Customer(String string) {
   }
 
   public Customer(String N, String S) {
      this();
      sequance = N;
   }
 
   public String getName() {
      return sequance;
   }
 
   public void setName(String letters) {
      this.sequance = letters;
   }
 
  
 
   public void print() {
      System.out.println(sequance + "\t"  );
   }
 
   @Override
   public int compareTo(Customer o) {
      return this.sequance.compareTo(o.sequance);
   }
 
}
 
public class Main {
   public static void main(String[] args) {
      Customer[] cust = new Customer[10];
      String name[] = { "ccc", "ddd", "bbb", "ddd", "aaa", "Alex",
            "Andrej", "Oleg", "Ivan", "Egor" };
      int i;
 
      System.out.println("All customers:");
 
      for (i = 0; i < cust.length; i++) {
         cust[i] = new Customer();
         cust[i].setName(name[i]);
         cust[i].print();
      }
 
System.out.println("Sorted alphabetically: ");
char alph[]={'a', 'b', 'c', 'd', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};  
 
    for (int x=0; x<alph.length; x++)
    {for (i=0; i<cust.length; i++)
    {
if (cust[i].getName().charAt(0)==alph[x])   
cust[i].print();
    }
  }
 
   }
}