Accessibility of derived classes to base class conversions

Source: Internet
Author: User
The accessibility of a transformation from a derived class to a base class depends on the access designator specified in the derived list of the derived class. to determine whether conversions to the base class are accessible, consider whether the public members of the base class can be accessed, and if so, the conversion is Accessible, otherwise, the conversion is inaccessible.
  • In the case of public inheritance, both user code and descendant classes can use the transformation of the derived class to the base class;
  • In the case of private or protected inheritance, the user code cannot convert the derived object class to the base class object;
  • Note: If protected is inherited, members of subsequent derived classes can be converted to base class types.

Accessibility of derived classes to base class conversions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.