What will be the output of the following program?
public class NValueIs {
public static void main(String[] args) {
int num1 = 1;
int num2 = 2;
System.out.println("Before swap method, num1 is " + num1 + " and num2 is " + num2);
swap(num1, num2);
System.out.println("After swap method, num1 is " + num1 + " and num2 is " + num2);
}
public static void swap(int n1, int n2) {
int temp = n1;
n1 = n2;
n2 = temp;
}
}