473,372 Members | 1,197 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

Is it possible to create virtual class to force the class must inherited?

ABC
as subject.

I have two classes, one is sealed class that will call or access the another
class properties or methods. But, now, the another class is for future use
and unknow what properties will add. I don't want to modify sealed class
when the another class properties or new methods added. Is there any best
strategies?
Jan 11 '06 #1
1 1095
ABC wrote:
I have two classes, one is sealed class that will call or access the another
class properties or methods. But, now, the another class is for future use
and unknow what properties will add. I don't want to modify sealed class
when the another class properties or new methods added. Is there any best
strategies?


It's not entirely clear what you mean, but I *suspect* you're after
interfaces or abstract classes. You put in the interface (or abstract
class) all the things that the sealed class cares about, and then that
can be implemented/derived from by other classes.

Jon

Jan 11 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: vijay | last post by:
I have a doubt with size of classed with virtual functions I have declared A,A1,A2 ,B , C, D some classes with no varaibles but a vitual function each, The size of A is as expected 4 bytes with...
16
by: BCC | last post by:
Hi, If I have a base class with a virtual function defined: class CBase { virtual void Foo(); }; void CBase::Foo() { // base class functionality
6
by: John | last post by:
I'm inheriting from multiple abstract base classes (2 to be exact). In the inherited class I want to know if I can implement two pure virtual methods (one from each base class) having the same...
24
by: Shao Zhang | last post by:
Hi, I am not sure if the virtual keyword for the derived classes are required given that the base class already declares it virtual. class A { public: virtual ~A();
8
by: Heiner | last post by:
Hi! The following snippet class B; class A { public:
6
by: Hubert Fritz | last post by:
Hello, I fear I want to have something which is not possible in C++. How is it possible to define a base class so that the derived class is forced to contain a static member variable, which...
8
by: Karsten Schramm | last post by:
Hi, when I run the following code: using System; namespace ConsoleApplication22 { class Program {
6
by: newbie | last post by:
class AbstractBox { public: virtual double area() const = 0; } class BoxA : public AbstractBox { virtual double area() { return 0.1; } } class BoxB : public AbstractBox {
1
by: Tony Johansson | last post by:
Hello! I have three classes below. These are Animal as a base class and one derived class called Cat. The main in within class Tester. If I compile the program as it is now I get the...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.