Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import net.mindview.util.Print.*;
- class Room{
- private Integer width;
- private Integer height;
- public Integer getWidth(Integer width){
- return width;
- }
- public Room setWidth(){
- if (width !=0) {
- return width;
- }
- }
- public Integer getHeight(Integer height){
- return height;
- }
- public Room setHeight(){
- if (height !=0) {
- return height;
- }
- }
- }
- class RoomObj extends Room{
- private Integer x;
- private Integer y;
- private Integer height;
- private Integer width;
- public int getX(){
- return x;
- }
- public void setX(int x){
- if(x!=null){
- this.x=x;
- }
- }
- public int getY(){
- return y;
- }
- public void setY(int y){
- if (y!=0) {
- this.y=y;
- }
- }
- public Integer getWidth(Integer width){
- return width;
- }
- public RoomObj setWidth(){
- if (width !=0) {
- return width;
- }
- }
- public Integer getHeight(Integer height){
- return height;
- }
- public RoomObj setHeight(){
- if (height !=0) {
- return height;
- }
- }
- }
- class Table extends RoomObj{
- int x;
- int y;
- }
- public class Run{
- public static void main(String[] args) {
- Room room = new Room();
- room.setHeight();
- Table table = new Table();
- table.setY(1);
- table.setX(3);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement