Kod:
import java.util.LinkedList;
import java.util.Iterator;




public class KUYRUK{//**kuyruk yapısı ilk giren ılk cıkar
public static void main(String args[]){


      String s1="TÜRKİYE";
      String s2="JAPONYA";
      String s3="RUSYa";




    LinkedList y=new LinkedList();


    y.addFirst(s1);
    y.addFirst(s2);
    y.addFirst(s3);


     Iterator Iterator=y.listIterator();


     while(Iterator.hasNext()){
         System.out.println("->"+Iterator.next());
     }


     y.removeLast();


     System.out.println(" verı cıktıktan  sonra");
     Iterator Iterator2=y.listIterator();
     while(Iterator2.hasNext()){
         System.out.println("->"+Iterator2.next());
     }




}
}