Recommended: Sing it, brah! 5 fabulous songs for developers
JW's Top 5
Why the following code requires xMethdod to be declared Static? xMethod is a member of Test.
public class Test {
public static void main(String[] args) {
int n = 2;
xMethod(n);
System.out.println("n is " + n);
}
void xMethod(int n) {
n++;
}
}