Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Rectangle {
- private int width;
- private int height;
- private int red,green,blue;
- public int area() { return width * height; }
- //just an example, didn't check the api.
- public Color color () { return new Color (red, green, blue); }
- }
- public class Rectangle {
- private Dimension size;
- private Color color;
- ...
- }
- public class A {
- private String a1;
- public void aMeth () {
- print(a1);
- }
- }
- public class B {
- private String b1;
- public void bMeth () {
- print(b1);
- }
- }
- public class A {
- private A a;
- private B b;
- ... insert infinite regress
- }
- public class Rectangle {
- private int width;
- private int height;
- private int red,green,blue;
- public int area() { return width * height; }
- //just an example, didn't check the api.
- public Color color () { return new Color (red, green, blue); }
- }
- public class Rectangle {
- private int lenght = 0;
- private int width = 0;
- public Rectangle (int length, width)
- {
- this.length = length;
- this.width = width;
- }
- public int getLength(int length)
- {
- return length;
- }
- public int getWidth(int width)
- {
- return wdith;
- }
- public void setLength(int length)
- {
- this.length = length;
- }
- public void setWidth(int width)
- {
- this.width = width;
- }
- }
Add Comment
Please, Sign In to add comment