Question

Questions are Object Oriented Programming with C++ related 1. Write a syntax to declare a static...

Questions are Object Oriented Programming with C++ related

1. Write a syntax to declare a static data member named count of a class named Base.

2. Can polymorphism be used with protected inheritance in C++? why or why not?

3. With a given code, how will you check whether the code applies polymorphism correctly?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Question#1

#include<iostream>

using namespace std;

class base {

static int count;

};

Question#2

Yes we can use polymorphism for the protected variables as we can use them as we have declared that class publically to the other class so in that we can access their variables very easily

Question#3

The main symbol of checking that the class applies the polymorphism concept or not is that you can check it through by seeing if in the class inheritance is done and the declaration of virtual and pure virtual function is been used so through it we can detect that the polymorphism is been used in the code.

PLEASE GIVE A THUMBS UP!!!! DONT GIVE A THUMBS DOWN IF YOU HAVE ANY QUERY SO COMMENT DOWN I WILL CLEAR IT FOR YOU

Add a comment
Know the answer?
Add Answer to:
Questions are Object Oriented Programming with C++ related 1. Write a syntax to declare a static...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT