Created
February 28, 2016 14:24
-
-
Save SanjeevMohindra/7189c03fe55e1accf2d8 to your computer and use it in GitHub Desktop.
This file contains 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
package callbyvalue; | |
public class PrimitiveCall { | |
public static void main(String[] args) { | |
int x = 10; | |
System.out.println("Value of x before the call: " + x); | |
add(x); | |
System.out.println("Value of x after the call: " + x); | |
} | |
private static void add(int x) { | |
x = x + 10; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment