Miguel Ho
Miguel Ho

Reputation: 21

Need to clarify some concept of the relation of the class. new to programming

Here is the sample:

class A{
    class AA{}
}
class B:A{
}

For class A, We can say AA is the subclass of A. However, for class AA, A is the ???? of AA?

For class A, B is the child class of A Can I say A is the ???? of B?

Upvotes: 1

Views: 82

Answers (2)

Dan
Dan

Reputation: 9837

AA is referred to as a "nested" class. Class A would be the container of class AA. Class AA is not visible outside class A unless it is marked as public. Class B is a child of class A. Class A is a base class of class B.

Upvotes: 0

dtb
dtb

Reputation: 217313

AA is a nested or inner type. It's not a subclass. A is the containing or outer type.

B derives from A. It's a derived class. A is the base class.

See also:

Upvotes: 5

Related Questions