Advertisement
Guest User

Untitled

a guest
Aug 30th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. class A {
  2. private B b;
  3.  
  4. public int abc() {
  5. return b.abc(value1, value2, value3);
  6. }
  7. }
  8.  
  9. class B {
  10. private C c;
  11.  
  12. public int abc(int x, int y, int z) {
  13. return c.abc(x, y, z);
  14. }
  15. }
  16.  
  17. class C {
  18. public int abc(int x, int y, int z) {
  19. // Do something with parameters x, y, z, e.g.:
  20. return x + y + z;
  21. }
  22. }
  23.  
  24. class XYZParameterObject {
  25.  
  26. private int x, y, z;
  27.  
  28. public constructor(int x, int y, int z) {
  29. this.x = x;
  30. this.y = y;
  31. this.z = z;
  32. }
  33.  
  34. public int abc() {
  35. return x + y + z;
  36. }
  37. }
  38.  
  39. class A {
  40. private B b;
  41.  
  42. public int abc() {
  43. return b.abc(new XYZParameterObject(value1, value2, value3));
  44. }
  45. }
  46.  
  47. class B {
  48. private C c;
  49.  
  50. public int abc(XYZParameterObject xyz) {
  51. return c.abc(xyz);
  52. }
  53. }
  54.  
  55. class C {
  56. public int abc(XYZParameterObject xyz) {
  57. // Do something with parameters x, y, z, e.g.:
  58. return xyz.abc();
  59. }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement