public class X {
2. private static int a;
3.
5. public static void main (String[] args) {
6. modify (a);
7. }
8.
9. public static void modify (int a) {
10. a++;
11. }
why it is printing '0" ..as per the question int a should get increased and print 1
I am not understanding this
The value of the parameter 'a' is incremented, it had the same value as the
value of the private static int member with the same name. Because you didn't
explicitly initialize that static member it has the value zero.
Java passes parameters by value; always; no exception to the rule.
I don't understand why you think anything is printed at all.
kind regards,
Jos