Created
March 20, 2019 20:03
-
-
Save AAQ-AND-DEV/244f986be8960f3a6505cc5526315812 to your computer and use it in GitHub Desktop.
const and final workbook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
//each of these must be initialized and can't be changed | |
const pi = 3.14; | |
final pi2 = 3.14; | |
//final collections may be mutable, const collections immutable | |
const immutableList = [2,3,4,5,6]; | |
//get 'unsupported operation: add' exception | |
//immutableList.add(7); | |
for (var num in immutableList) print(num); | |
final mutableList = [2,3,4,5,6]; | |
mutableList.add(7); | |
for (var num in mutableList) print(num); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment