+ 2
How 6 is printed even though x is a static member
Static members in java https://code.sololearn.com/ce4G0x2FIfB2/?ref=app
2 odpowiedzi
+ 4
Because at the end of the m() method the value of a is returned. a is the same value the is passed to the m() method. Even though the value of x is changed within the m(), it is then set to the value of a back in main() which is 6.
+ 1
ChaoticDawg thank you