kiem tien, kiem tien online, kiem tien truc tuyen, kiem tien tren mang
Thứ Năm, 20 tháng 2, 2014

class A.
class B kế thừa lớp A.

Ngôn ngữ C++:
class A
{
  public:
       virtual void Method()
       {
            // Code
       }

};

class B kế thừa class A và bổ sung thêm code co phương thức Method thì sử dụng " :: " :

class A:public B
{
  public:
     void Method()
      {
          A::Method();
          // Code;
      }

};


Ngôn ngữ C#:
class A
{
  public virtual void Method()
       {
               // Code
        }

}

class B kế thừa class A và bổ sung thêm code co phương thức Method thì sử dụng " base " :

class A:B
{
  public  void Method()
      {
          base.Method();
          // Code;
      }
}

Ngôn ngữ Java:
class A
{
  public virtual void Method()
       {
               // Code
        }

}

class B kế thừa class A và bổ sung thêm code co phương thức Method thì sử dụng " super " :

class A extends B
{
  public  void Method()
      {
          super.Method();
          // Code;
      }
}      
20 Feb 2014

0 nhận xét:

Đăng nhận xét

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.

domain, domain name, premium domain name for sales

Bài đăng phổ biến