A protected member inherited in public mode becomes ______ , whereas inherited in private mode becomes ______ in the derived class.
protected:)private
举一反三
- Which one of the following statements is wrong about inheritance? ( ) A: Inheritance is one of the features of OOP B: Protected members of a class can be inherited C: The inheriting class is called a subclass D: Private members of a class can be inherited and accessed
- You want to limit access to a method of a public class to members of the same class. Which access accomplishes this objective?() A: public B: private C: protected D: transient E: default access
- 不是修饰符的是() A: public B: private C: protected D: class
- 下列哪个类的声明是正确的?( ) A: class A B: class public A C: protected class A D: private class A
- 定义类的关键字是( )。 A: class B: private C: protected D: public
内容
- 0
关于类的声明,以下正确的是() A: abstract final class A{} B: abstract private A(){} C: protected private A D: public abstract class A{}
- 1
下列哪些类声明是错误的?() A: public<br/>class A B: protected<br/>class A C: private<br/>class A D: class A
- 2
Which can be inherited by derived classes in the C++ () A: Constructor B: virtual function C: destructor D: friend function
- 3
有以下程序: #include <iostream> using namespace std; class Base{ public: Base(int x=0) {cout<<x;} }; class Derived : public Base{ public: Derived(int x=0) {cout<<x;} private: Base val; }; int main(){ Derived d(1); return 0; } 程序的输出结果是
- 4
下面哪个类声明是正确的( ) A: abstract final class A; B: abstract private move(); C: protected private number; D: public class B;