Thu May 05, 2011 8:05 am
Thu May 05, 2011 6:43 pm
// scanner to read user input.
Scanner myscan = new Scanner(System.in);
List<Integer> arrayList = new ArrayList<Integer>();
// First array list .
for(int i=0;i<10;i++){
int newvalue =myscan.nextInt();
if(arrayList.indexOf(newvalue)==-1){
// newvalue is not in array .
arrayList.add(newvalue);
}
}
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.