Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Test
- @Ignore
- public void privateMethod() {
- C c1 = new C(1);
- C c2 = new C(2);
- System.out.println(c2.test(c1));
- System.out.println(c1.test(c2));
- }
- private class C {
- private int x = 1;
- public C(int x) {
- this.x = x;
- }
- private int m() {
- return x;
- }
- public int test(C other) {
- return other.m();
- }
- }
- // Prints out:
- // 1
- // 2
Advertisement
Add Comment
Please, Sign In to add comment