We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent db4e409 commit 8f0441cCopy full SHA for 8f0441c
collections/linkedlist/linkedlist-addfirst-method/LinkedListAddFirst.java
@@ -0,0 +1,24 @@
1
+package com.gaurav.ExProject.LinkedList;
2
+
3
+import java.util.LinkedList;
4
5
+public class LinkedListAddFirst {
6
7
+ public static void main(String[] args) {
8
9
+ LinkedList<String> linkedList = new LinkedList<String>();
10
+ linkedList.add("Austin");
11
+ linkedList.add("Boston");
12
+ linkedList.add("Atlanta");
13
+ linkedList.add("Madison");
14
+ linkedList.add("Columbia");
15
16
+ System.out.println(linkedList);
17
18
+ // add element at the beginning
19
+ linkedList.addFirst("Albany");
20
21
22
+ }
23
24
+}
0 commit comments