Java linkedList

Posted: September 16, 2014 in Java
Tags:

Elemanlar eklenirken aralarında bir bağ bulunur.listenin sonuna ,başına eleman eklenebilir.Sondaki ve baştaki elemana erişilebilir.

import java.util.LinkedList;

public class JavaApplication21 {

public static void main(String[] args) {

LinkedList x = new LinkedList();

x.add(“bayram”);
x.add(“zafer”);
x.add(“cihad”);
x.add(“memo”);
x.addFirst(“reci”);
x.addLast(“mann”);

System.out.println(x);

}

}

linkedlist

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s