consider following statements
1. when we initialize a primitive or assign the value to a primitive variable the bits of the primitive are copied into the variable
2. The bits of primitive denotes the primitive value
3. so when we assign a primitive variable to another primitive variable, then the bits of first variable are copied into another variable
here in our case
when we define int size = 7
the bits of the value 7 are copied into variable size
now
when we are passing the size variable to the method
Always remember that when passing values to the method , always the copy of the variable is passed and not the actual variable
so when we call the changeIt method using
then the size variable is passed to the method
now the method declaration shows
then the size variable here is actually the alias variable (we can write any variable name here (confusion is because the same name is given))
here the bits are copied to size variable and that alias also contains the value 7
now in the method we add 200 to the size variable that is the method argument (not the static size variable)
and we print the variable in so it gives 207
now when the method completes
then the size variable (the method argument) is not available out of the method
and after the method we are printing the size variable again
this time the size variable is the static variable (and it was unchanged because the copy of it was passed to the method argument in changeIt(size))
hope this is clear to you now
you will find it more interesting when you study the shadowing of reference variables
happy preparation