Question
Consider the following C++ code: #include class Base { public: Â Â virtual void show() = 0; }; class Derived : public Base { public: Â Â void show() override { Â Â Â Â std::cout
Solution
o In C++, Base is declared with virtual void show() = 0;, which makes show() a pure virtual function. o Any class that contains one or more pure virtual functions is an abstract class. o Abstract classes cannot be instantiated directly. Attempting to create an object of an abstract class (like Base b;) will result in a compile-time error. The compiler will typically issue a message similar to "cannot declare variable 'b' to be of abstract type 'Base'" or "cannot instantiate abstract class 'Base'".
- Which of these AI approaches involves agents learning by interacting with their environment?
- The "load factor" of a hash table is a critical metric. What does it represent?
- The Process Control Block (PCB) does not typically contain which of the following information?
- Consider a system with 4 CPU cores. If there are 8 user-level threads in a single process, what is the maximum number of these threads that can execute con...
- Transfer function of closed loop system with negative feedback is defined as___
- Which of the following statements accurately describes Third Normal Form (3NF) in database normalization?
- Which algorithmic paradigm does the Floyd-Warshall algorithm primarily use?
- The following Python code attempts to call a method from the parent class, but it's using an outdated or incorrect syntax. How should it be corrected? cla...
- Predict the output list1 = ['physics', 'chemistry', 1997, 2000] list2 = [1, 2, 3, 4, 5, 6, 7 ] print "list1[0]: ", list1[0]
- Frame relay :