类的调用1(被调用的MyFirstJava)

时间:2023-12-20 21:31:38

package com.mec.MyFirstJavaLife.text;

public class MyFirstJava {

/**   * @param args   */

private int row;   private int col;

public MyFirstJava() {

System.out.println("执   行   了   类:AboutSimpleObject的构造方法!");

setrow(0);

setcol(0);

}

public void setrow(int row){

if(row<1||row>25){

row=1;

}

this.row=row;

}

public int getrow(){

return row;   }

public void setcol(int col){

if(col<1||col>80){

col=1;

}

this.col=col;

}

public int getcol(){

return col;

}

}