Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package targeeeee;
- public class mal {
- private int H;
- private int W;
- public mal(int hight, int width) {
- this.H = hight;
- this.W = width;
- }
- public int hi(){
- int hykef = 0;
- hykef=H*W;
- System.out.println(hykef);
- return hykef;
- }
- public void she(){
- int sh = 0;
- sh=(H*2)+(W*2);
- System.out.println(sh);
- }
- public void print(){
- for(int i=0;i<H;i+=1){
- for(int j=0;j<W;j+=1){
- System.out.println("*");
- System.out.println();
- }
- }
- }
- public mal() {
- this(10,10);
- }
- public int getH() {
- return H;
- }
- public void setH(int h) {
- H = h;
- }
- public int getW() {
- return W;
- }
- public void setW(int w) {
- W = w;
- }
- }
- //**main**//
- package targeeeee;
- public class tester {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- mal m = new mal();
- m.hi();
- m.she();
- m.print();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement