Advertisement
votako

why didn't work?!

Nov 20th, 2012
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.23 KB | None | 0 0
  1. import net.mindview.util.Print.*;
  2.  
  3. class Room{
  4.     private Integer width;
  5.     private Integer height;
  6.  
  7.     public Integer getWidth(Integer width){
  8.         return width;
  9.     }
  10.     public  Room setWidth(){
  11.         if (width !=0) {
  12.                 return width;
  13.         }
  14.     }
  15.  
  16.     public Integer getHeight(Integer height){
  17.         return height;
  18.     }
  19.     public Room setHeight(){
  20.         if (height !=0) {
  21.                 return height;
  22.         }
  23.     }
  24.  
  25. }
  26.  
  27. class RoomObj extends Room{
  28.     private Integer x;
  29.     private Integer y;
  30.     private Integer height;
  31.     private Integer width;
  32.  
  33.     public int getX(){
  34.         return x;
  35.     }
  36.     public void setX(int x){
  37.         if(x!=null){
  38.             this.x=x;
  39.         }
  40.     }
  41.  
  42.     public int getY(){
  43.         return y;
  44.     }
  45.     public void setY(int y){
  46.         if (y!=0) {
  47.             this.y=y;
  48.         }
  49.     }
  50.  
  51.     public Integer getWidth(Integer width){
  52.         return width;
  53.     }
  54.     public RoomObj setWidth(){
  55.         if (width !=0) {
  56.                 return width;
  57.         }
  58.     }
  59.  
  60.     public Integer getHeight(Integer height){
  61.         return height;
  62.     }
  63.     public RoomObj setHeight(){
  64.         if (height !=0) {
  65.                 return height;
  66.         }
  67.     }
  68.  
  69. }
  70.  
  71. class Table extends RoomObj{
  72.     int x;
  73.     int y;
  74. }
  75.  
  76. public class Run{
  77.     public static void main(String[] args) {
  78.         Room room = new Room();
  79.         room.setHeight();          
  80.         Table table = new Table();
  81.         table.setY(1);
  82.         table.setX(3);
  83.     }
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement