linked list

how do i create a  class using which a linked list can be created given an integer array as input through main
Who is Participating?
surendraboppanaConnect With a Mentor Commented:
if ur not really interested in how the linked list works u  can directly use 'LinkedList' class defined in "java.util.LinkedList".u can use the predefined methods like

3.boolean contains(object)
5.u can sort the elements using the algo's in 'Collections'

here isthe sample code

public void main(String args[])
    Object array[]=..
    LinkedList ll=newLinkedList(aslist(array []));
  now the linkedlist ll contains all the elements of the array.

i think this should do
Java already has a LinkedList class.
If you just need a list and you're not fussed about whether it is implemented as a linked list or not you could use the following:

Object[] array = .....;
List l = Arrays.asList(array);

Or if you explicitly require a linked list try:

LinkedList l = new LinkedList(Arrays.asList(array));

sorry to hijack this thread, abi_jacob: could you please follow up on your other question which has had no response from you for nearly a month.
The new generation of project management tools

With’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

surendraboppana please read the guidelines on comments vs answers at the bottom of the page. Your "answer" is substantially similar to a comment already posted. It is considered bad form to post answers in this way and continued posting may lead to your account being referred to customer services for possible penalty.
Thanks Tim, you saved me a few keystrokes.
Answer proposing seems to be on the rise :(
objects, no problem I know I hijacked the thread in the first place to prod abi_jacob into a response, (I think that he/she may now have abandoned this one as well) but even I as a non-java person can see that the "answer" is pretty much what you had already said. I can't let that sort of thing go without a response. I wish they would fix that withdraw proposed answer option soon, especially when you have a questioner that seems to have abandoned the thread, there is nothing you can do about it except contact CS.
Personally don't see the point in having a "Propose Answer" option at all. Personally I've never used it.
Only the question asker can tell if there question has been answered.

Poor form!!!!
All Courses

From novice to tech pro — start learning today.