วันอาทิตย์ที่ 11 มีนาคม พ.ศ. 2555

Test_java2

4 ความคิดเห็น:

  1. circle - > Geometric -> Test

    package mypg;

    public class Circle extends Geometric{
    private double radius;

    public Circle (double radius)
    {
    this.radius = radius;

    }
    public Circle(double radius,String color)
    {
    this.radius = radius;
    setColor(color);
    }
    public double getArea()
    {
    return radius * radius * Math.PI;
    }
    }

    ................................................................

    package mypg;
    import java.util.*;

    public class Geometric {
    private String color = "white";
    private Date dateCreated;
    public Geometric()
    {
    dateCreated = new Date();

    }
    public Geometric (String color)
    {
    this.color = color;
    }
    public void setColor(String color)
    {
    this.color = color;
    }
    public String getColor()
    {
    return this.color;
    }
    public Date getDate(){
    return dateCreated;
    }

    }

    ........................................
    package mypg;

    public class Test {

    public static void main(String[] args) {
    Geometric geo1 = new Geometric();
    System.out.println(geo1.getColor()+" ; "+geo1.getDate());
    Circle cir1 = new Circle(4);
    cir1.setColor("red");
    System.out.println(cir1.getColor()+ " ; " +cir1.getDate() + " ; " +cir1.getArea());

    }

    }

    ตอบลบ
  2. ebook => http://www.mediafire.com/?ejz5alkoq7h37b5
    ---------------------------------------------------------------------------------------------------
    test lap_java 2.rar => http://www.mediafire.com/?1mhkxpesshctkm5

    ตอบลบ
  3. อ่ะเค thank you ติดตามๆๆๆ 55

    ตอบลบ