MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / PassObject

Class PassObject

operators/PassObject.java:12–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10}
11
12public class PassObject {
13 static void f(Letter y) {
14 y.c = 'z';
15 }
16 public static void main(String[] args) {
17 Letter x = new Letter();
18 x.c = 'a';
19 System.out.println("1: x.c: " + x.c);
20 f(x);
21 System.out.println("2: x.c: " + x.c);
22 }
23}
24/* Output:
251: x.c: a
262: x.c: z

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected