Guest User

Untitled

a guest
Jun 20th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. public class Rectangle {
  2. private int width;
  3. private int height;
  4. private int red,green,blue;
  5. public int area() { return width * height; }
  6. //just an example, didn't check the api.
  7. public Color color () { return new Color (red, green, blue); }
  8. }
  9.  
  10. public class Rectangle {
  11. private Dimension size;
  12. private Color color;
  13. ...
  14. }
  15.  
  16. public class A {
  17. private String a1;
  18. public void aMeth () {
  19. print(a1);
  20. }
  21. }
  22. public class B {
  23. private String b1;
  24. public void bMeth () {
  25. print(b1);
  26. }
  27. }
  28.  
  29. public class A {
  30. private A a;
  31. private B b;
  32. ... insert infinite regress
  33. }
  34.  
  35. public class Rectangle {
  36. private int width;
  37. private int height;
  38. private int red,green,blue;
  39. public int area() { return width * height; }
  40. //just an example, didn't check the api.
  41. public Color color () { return new Color (red, green, blue); }
  42. }
  43.  
  44. public class Rectangle {
  45.  
  46. private int lenght = 0;
  47. private int width = 0;
  48.  
  49. public Rectangle (int length, width)
  50. {
  51. this.length = length;
  52. this.width = width;
  53. }
  54.  
  55. public int getLength(int length)
  56. {
  57. return length;
  58. }
  59.  
  60. public int getWidth(int width)
  61. {
  62. return wdith;
  63. }
  64.  
  65.  
  66. public void setLength(int length)
  67. {
  68. this.length = length;
  69. }
  70.  
  71. public void setWidth(int width)
  72. {
  73. this.width = width;
  74. }
  75. }
Add Comment
Please, Sign In to add comment