Advertisement
Guest User

Untitled

a guest
Sep 17th, 2014
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. public class TuGiac {
  2.   protected Diem d1, d2, d3, d4;
  3.   public void setD1(Diem _d1) {d1=_d1;}
  4.   public Diem getD1(){return d1;}
  5.   public void printTuGiac(){...}
  6.   …
  7. }
  8.  
  9. public class HinhVuong extends TuGiac {
  10.     public HinhVuong(){
  11.         d1 = new Diem(0,0); d2 = new Diem(0,1);
  12.         d3 = new Diem(1,0); d4 = new Diem(1,1);
  13.     }
  14. }
  15. public class Test{
  16.     public static void main(String args[]){
  17.         HinhVuong hv = new HinhVuong();
  18.         hv.printTuGiac();
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement