List
- It allows Duplicate values .
- It maintains insertion order.
- List maintains index based.
- It allows multiple null values.
Syntax
List<Datatype> variable name = new List<Datatype>();
Examples
- List<integer> a = new List<integer>();
- List<Account> b = new List<Account>();
- List<integer> ages; Ages = new List<integer>();
- List<integer> ages = new List<integer>(){20,30,50};
Methods available in List
- add(Element);
- add(index,Element);
- addAll(list 1);
- size();
- set(index,Element);
- remove(index);
- clear();l
- get(index);
- isEmpty();
- SORT();
No comments:
Post a Comment