Would any one help me how to use java built in LinkedList.
By using Scanner or BufferedReader for the input...
*Creating a list of Books
*By adding at Last
*and Removing at First
if possible also a list customer waiting for the book...but it's not require...
Comments
: By using Scanner or BufferedReader for the input...
:
: *Creating a list of Books
: *By adding at Last
: *and Removing at First
:
: if possible also a list customer waiting for the book...but it's not require...
:
:
I don't know how to use the BufferedReader, but here's how to add and remove:
[code]
bookList.addLast(bookObj); // adding after last item
bookList.removeFirst(); // removing the first
[/code]
Source: http://java.sun.com/j2se/1.5.0/docs/api/java/util/LinkedList.html#addLast(E)
and
http://java.sun.com/j2se/1.5.0/docs/api/java/util/LinkedList.html#removeFirst()