Advertisement
Guest User

Untitled

a guest
Jan 17th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.00 KB | None | 0 0
  1. package targeeeee;
  2.  
  3. public class mal {
  4.     private int H;
  5.     private int W;
  6.  
  7.     public mal(int hight, int width) {
  8.         this.H = hight;
  9.         this.W = width;
  10.        
  11.     }
  12.     public int hi(){
  13.         int hykef = 0;
  14.         hykef=H*W;
  15.         System.out.println(hykef);
  16.         return hykef;
  17.     }
  18.     public void she(){
  19.         int sh = 0;
  20.         sh=(H*2)+(W*2);
  21.         System.out.println(sh);
  22.     }
  23.     public void print(){
  24.         for(int i=0;i<H;i+=1){
  25.             for(int j=0;j<W;j+=1){
  26.                 System.out.println("*");
  27.                 System.out.println();
  28.             }
  29.            
  30.         }
  31.     }
  32.  
  33.     public mal() {
  34.         this(10,10);
  35.        
  36.     }
  37.  
  38.     public int getH() {
  39.         return H;
  40.     }
  41.  
  42.     public void setH(int h) {
  43.         H = h;
  44.     }
  45.  
  46.     public int getW() {
  47.         return W;
  48.     }
  49.  
  50.     public void setW(int w) {
  51.         W = w;
  52.     }
  53.  
  54. }
  55.  
  56. //**main**//
  57.  
  58. package targeeeee;
  59.  
  60.  
  61.  
  62. public class tester {
  63.  
  64.     public static void main(String[] args) {
  65.         // TODO Auto-generated method stub
  66.         mal m = new mal();
  67.         m.hi();
  68.         m.she();
  69.         m.print();
  70.     }
  71.  
  72.  
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement