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

Polymorphism


nแปลว่า หลายรูปทรง แปลงสภาพได้
Example
class CustomerData{
   protected void CustomerPhone(){
        System.out.println(“02 123 456”);
   {
   protect void ClearAll(){
        System.out.println(“Delete All Data”);
   }
}
+++++++++++++++++++++++++++++++++++++++++ๅๅๅๅ
เวลาเรียกใช้
class CustomerData2 extends CustomerData {
   protected void CustomerPhone(){
         super.CustomerPhone();
         System.out.println(“02 123 456 7”);
   {
   protect void ClearAll(){
   }
}


ไม่มีความคิดเห็น:

แสดงความคิดเห็น