Search elements of LinkedList Java example : Link List « Collections Data Structure « Java

Java
1. 2D Graphics GUI
2. 3D
3. Advanced Graphics
4. Ant
5. Apache Common
6. Chart
7. Class
8. Collections Data Structure
9. Data Type
10. Database SQL JDBC
11. Design Pattern
12. Development Class
13. EJB3
14. Email
15. Event
16. File Input Output
17. Game
18. Generics
19. GWT
20. Hibernate
21. I18N
22. J2EE
23. J2ME
24. JDK 6
25. JNDI LDAP
26. JPA
27. JSP
28. JSTL
29. Language Basics
30. Network Protocol
31. PDF RTF
32. Reflection
33. Regular Expressions
34. Scripting
35. Security
36. Servlets
37. Spring
38. Swing Components
39. Swing JFC
40. SWT JFace Eclipse
41. Threads
42. Tiny Application
43. Velocity
44. Web Services SOA
45. XML
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java » Collections Data Structure » Link ListScreenshots 
Search elements of LinkedList Java example
   

import java.util.LinkedList;

public class Main {
  public static void main(String[] args) {
    LinkedList<String> lList = new LinkedList<String>();
    lList.add("1");
    lList.add("2");
    lList.add("3");
    lList.add("4");
    lList.add("5");
    lList.add("2");

    System.out.println(lList.indexOf("2"));

    System.out.println(lList.lastIndexOf("2"));

  }
}

   
    
    
  
Related examples in the same category
1. Use for each loop to go through elements in a linkedlist
2. Use addFirst method to add value to the first position in a linked list
3. To insert an object into a specific position into the list, specify the index in the add method
4. Updating LinkedList Items
5. Convert LinkedList to Array with zero length array
6. Convert LinkedList to Array with full length array
7. Checking what item is first in line without removing it: element
8. Removing the first item from the queue: poll
9. Convert a LinkedList to ArrayList
10. Add elements at beginning and end of LinkedList Java example
11. Check if a particular element exists in LinkedList Java example
12. Create an object array from elements of LinkedList Java example
13. Get elements from LinkedList Java example
14. Get first and last elements from LinkedList Java example
15. Get SubList from LinkedList Java example
16. Iterate through elements of Java LinkedList using Iterator example
17. Remove all elements or clear LinkedList Java example
18. Iterate through elements of Java LinkedList using ListIterator example
19. Remove first and last elements of LinkedList Java example
20. Remove range of elements from LinkedList Java example
21. Remove specified element from LinkedList Java example
22. Replace an Element of LinkedList Java example
23. Add or insert an element to ArrayList using Java ListIterator Example
24. Finding an Element in a Sorted List
25. Create a list with an ordered list of strings
26. Search for a non-existent element
27. Use an Iterator to cycle through a collection in the forward direction.
28. Implementing a Queue with LinkedList
29. Implementing a Stack
30. Using a LinkedList in multi-thread
31. Convert Collection to ArrayList
32. Wrap queue to synchronize the methods
33. Making a stack from a LinkedListMaking a stack from a LinkedList
34. Single linked list
35. Double LinkedList
36. Doubly Linked listDoubly Linked list
37. A class for you to extend when you want object to maintain a doubly linked list
38. A simple Doubly Linked list class, designed to avoid O(n) behaviour on insert and delete.A simple Doubly Linked list class, designed to avoid O(n) behaviour on insert and delete.
39. A List helper class that attempts to avoid unneccessary List creation.
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.