Theoretical Paper
- Computer Organization
- Data Structure
- Digital Electronics
- Object Oriented Programming
- Discrete Mathematics
- Graph Theory
- Operating Systems
- Software Engineering
- Computer Graphics
- Database Management System
- Operation Research
- Computer Networking
- Image Processing
- Internet Technologies
- Micro Processor
- E-Commerce & ERP
- Dart Programming
Practical Paper
Industrial Training
Dart Programming - Collection
Dart, unlike other programming languages, doesn’t support arrays. Dart collections can be used to replicate data structures like an array. The dart:core library and other classes enable Collection support in Dart scripts.
Dart collections can be basically classified as −
Sr.No | Dart collection & Description |
1 | List
|
2 | Set |
3 | Maps |
4 | Queue |
Iterating Collections
The Iterator class from the dart:core library enables easy collection traversal. Every collection has an iterator property. This property returns an iterator that points to the objects in the collection.
Example
The following example illustrates traversing a collection using an iterator object.
.import 'dart:collection'; void main() { Queue numQ = new Queue(); numQ.addAll([100,200,300]); Iterator i= numQ.iterator; while(i.moveNext()) { print(i.current); } }
The moveNext() function returns a Boolean value indicating whether there is a subsequent entry. The current property of the iterator object returns the value of the object that the iterator currently points to.
It should produce the following output −
100 200 300