は私に、次のOOPの概念の名前を誰かを与えることができます:OOPの概念とは何ですか? (それは確かにある場合、すべてのOOPの概念を!)
私は2つのクラスがあります& B.を両方とも、たとえば異なる2つの方法ごと(すべてを持っています)。今、私は第三のクラスを作成し、C。今、私はCに& Bのすべてのメソッドを公開するここでは、デモのいくつかの並べ替えです:
class A
int method_in_A_one() {
}
int method_in_A_two() {
}
end
class B
int method_in_B_one() {
}
int method_in_B_two() {
}
end
class C
C() {
A an_instance_of_a;
B an_instance_of_b;
}
}
Now I want to be able to do this:
C instance_of_c = new C;
insance_of_c.method_in_A_one();
insance_of_c.method_in_A_two();
insance_of_c.method_in_B_one();
insance_of_c.method_in_B_two();
私は本当にまだこのための使用を持っていないが、私はそれを扱っている特定のコンセプトを確信しています。事前にありがとう、ell。
私はB an_instance_of_bを意味すると思います。 B an_instance_of_cの代わりに; ? – Roger
ええ、申し訳ありませんが、私は今、おかげでそれを修正します:) – Ell