import java.util.ArrayList;
import java.util.ListIterator;
public class previous {
public static void main(String[] args) {
char alphabet = 'a';
ArrayList list = new ArrayList();
while (alphabet != 'z') {
list.add(alphabet++);
}
ListIterator it = list.listIterator();
while (it.hasNext()) {
it.next();
}
while(it.hasPrevious())
{
System.out.print(it.previous()+" ");
}
}
}
Output
y x w v u t s r q p o n m l k j i h g f e d c b aIf you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.