Being able to trace how programs work by drawing memory models is super important! Here we focus on passing a method an int and then modifying the local value of that int. public class JavaPractice { public static void main(String[] args){ int count = 0; int sum = 20; method1(sum); } public static void method1(int input){ input = input + 5; int z = 29; } } Check out the next video about passing a reference to an array https://youtu.be/n-23Y4IygxM
Java Memory Models: Passing an int to a method - YouTube | |
4 Likes | 4 Dislikes |
159 views views | 2,205 followers |
Education | Upload TimePublished on 22 Jan 2019 |
Không có nhận xét nào:
Đăng nhận xét