Created
February 17, 2022 10:26
-
-
Save athulak/bce12b5fabc16f00e5b71f3b36f100d5 to your computer and use it in GitHub Desktop.
Pass by Value vs Pass by Reference
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<int> mithunMark = [10, 10, 10]; | |
//List<int> johnMark = mithunMark; | |
List<int> johnMark = [...mithunMark]; | |
mithunMark[0] = 20; | |
mithunMark[1] = 15; | |
print("Mithun's mark: "+mithunMark.toString()); | |
print("John's mark: "+johnMark.toString()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment