Last active
November 8, 2024 08:54
-
-
Save givip/62b2fc0f642507e8ecef27d3bd946c16 to your computer and use it in GitHub Desktop.
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(List<String> arguments) { | |
///-------------------------- | |
///-------------------------- | |
///Which expression is correct? | |
///If not, why? | |
///What kind of error/warnings/exceptions you'll get? | |
// final List<int> l1 = [0]; | |
// l1 = [1]; | |
// print(l1); | |
// final List<int> l2 = [0]; | |
// l2.add(2); | |
// print(l2); | |
// final List<int> l3 = const [0]; | |
// l3.add(2); | |
// print(l3); | |
// List<int> l4 = const [0]; | |
// l4.add(2); | |
// print(l4); | |
///What is print outputs? | |
///Why? | |
// final list1 = [1, 2]; | |
// final list2 = [1, 2]; | |
// final list3 = list1; | |
// print(list1 == list2); | |
// print(identical(list1, list2)); | |
// print(list1 == list3); | |
// print(identical(list1, list3)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment