Monday 15 August 2011

java - is there a way to instantiate an object of a class without giving the object a name? -


I want to instantiate a linked list node (I do not like Java link linked to list because it is only useless Allows to have a new node at the beginning or end of the list). I can have 50000 nodes and I give everybody a name when it is instant. I can go on the non-object route with the array of structures, but there is probably no way to work in OP mode.

So when you need to insert / remove from the middle, then you have a link in Java How do the list?

You can specify in the middle using the built-in by specifying that pointer and you want to include it in:

  LinkedList .add (index, element);   

Where element is the value you want to insert in the written list on the index .

No comments:

Post a Comment