1. class Q7 {
2. public static void main(String args[]){
3. double d = 12.3;
4. Decrementer dec = new Decrementer();
5. dec.decrement(d);
6. System.out.println(d);
7. }
8. }
9.
10. class Decrementer {
11. public void decrement(double decMe){decMe = decMe - 1.0;}
12. }
What value is printed out at line 6?
A. 0.0
B. -1.0
C. 12.3
D. 11.3
Answer:C is correct. The decrement() method is passed a copy of the argument d; the copy gets decremented, but the original is untouched.