Thu Dec 09, 2010 1:27 pm
import java.util.*;
public class Test {
Vector list;
String[] codes = {"alpha", "lambda", "gamma", "delta", "zeta"};
public Test(String[] userCodes){
list = new Vector();
//load built-in codes
for(int i = 0; i< codes.length; i++){
addCode(codes[i]);
}
//load user codes
for(int j = 0; j < userCodes.length; j++){
addCode(userCodes[j]);
}
//display all codes
for(Iterator ite = list.iterator(); ite.hasNext();){
String output = (String)ite.next();
System.out.println(output);
}
}
private void addCode(String code){
if(!list.contains(code)){
list.add(code);
}
}
public static void main(String args[]){
Test keeper = new Test(args);
}
}
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.