November 19, 2008 at 10:44 PM
Hi friend,
List interface :
* a List is a collection whose elements can be accessed by an index
* the indices are zero-based
* a list has methods for inserting and removing elements
* a list can contain duplicate elements
* a List provides a special ListIterator which allows you to move backwards and forwards through the elements
* there are three basic ways in which a List can be modified:
1. add an element
2. remove an element
3. replace an element
* a list can support any or none of the above; attempts to modify a list that does not support the above will result in an UnsupportedOperationException
* there is no way to append Lists unless you provide your own method
java.util Implementations of List :
It consists of ArrayList,LinkedList and Vector.
Your code is :
List values = new List();
List() constructor cannot be resolve :
So use List values = new ArrayList();
For more information on java.util package visit to :
http://www.roseindia.net/java/example/java/util/http://www.roseindia.net/java/beginners/array_list_demo.shtmlThanks
Related Tutorials/Questions & Answers:
syntax problem - Java Beginnerssyntax problem Hi ,
Im loading a particular css class for a specific div id using the
syntax shown below.Please tell me what is the
syntax if i have to perform a "not equal to check" fo the class name mentioned below
Advertisements
Java Syntax - Java BeginnersJava Syntax Hi!
I need a bit of help on this...
Can anyone tell me why i get an error [List cannot be resolved to a type] when i try to do...://www.roseindia.net/
java/beginners/array_list_demo.shtml
Thanks
Java Syntax - Java BeginnersJava Syntax Hi!
I need a bit of help on this...
Can anyone tell... to :
http://www.roseindia.net/
java/example/
java/util/
http://www.roseindia.net/
java/beginners/array_list_demo.shtml
Thanks
main() syntax - Java Beginners; Hi Friend,
Structure of
Java program:
[package declaration..., visit the following link:
http://www.roseindia.net/
java/
Thanks
How to Solve the Syntax Error in java??How to Solve the
Syntax Error in
java??
Syntax error in
java?
i have tried this program its showing error like this in Eclipse "
Syntax error...);
objectname.i ;
}
Hello Friend,ADS_TO_REPLACE_2
Actually your
syntax syntax error in SQL Insert Statement - Java Beginnerssyntax error in SQL Insert Statement Dear Sir ,I have write following code to save data into access databse,
but code gives following error
code... Access Driver]
Syntax error in
INSERT INTO statement.
plz Help Me Hi