Skip to content

Commit 7d76ced

Browse files
committed
Add example for get an index of element from linkedlist blog
1 parent 5837e94 commit 7d76ced

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

collections/linkedlist/get-an-index-of-element-of-linkedlist/LinkedListLastIndexOf.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ public static void main(String[] args) {
2525
System.out.println("LinkedList: ");
2626
System.out.println(linkedList);
2727

28-
// get first index of GoldSpot
28+
// get last index of GoldSpot
2929
int index = linkedList.lastIndexOf("GoldSpot"); // 6
3030

3131
System.out.println("\nIndex of the GoldSpot in linkedList is: "+ index);
3232

33-
// get first index of Moxie
33+
// get last index of Moxie
3434
int indexMoxie = linkedList.lastIndexOf("Moxie"); // 7
3535

3636
System.out.println("\nIndex of the Moxie in linkedList is: "+ indexMoxie);

0 commit comments

Comments
 (0)