29 lines
922 B
Java
29 lines
922 B
Java
public class Main {
|
|
public static void main(String[] args) {
|
|
Weapon weapon1 = new Weapon("dagger", 12);
|
|
Weapon weapon2 = new Weapon("sword", 10);
|
|
Weapon weapon3 = new Weapon("bow", 1);
|
|
|
|
LinkedList linkedList = new LinkedList();
|
|
System.out.println(linkedList.isEmpty());
|
|
System.out.println(linkedList.hasAccess());
|
|
System.out.println("Append:");
|
|
linkedList.append(weapon1);
|
|
System.out.println("Insert:");
|
|
linkedList.insert(weapon2);
|
|
System.out.println(linkedList.getSize());
|
|
System.out.println(linkedList.hasAccess());
|
|
System.out.println("Append:");
|
|
linkedList.append(weapon3);
|
|
|
|
|
|
linkedList.toFirst();
|
|
linkedList.toLast();
|
|
linkedList.toNext();
|
|
System.out.println(linkedList.getFirst());
|
|
System.out.println(linkedList.getLast());
|
|
|
|
linkedList.remove();
|
|
}
|
|
}
|