Click here to Skip to main content
15,887,444 members
Home / Discussions / C#
   

C#

 
GeneralRe: Storing RichText data in Access Database Field Pin
bjulien12-Feb-04 8:03
bjulien12-Feb-04 8:03 
GeneralRe: Storing RichText data in Access Database Field Pin
Heath Stewart12-Feb-04 8:36
protectorHeath Stewart12-Feb-04 8:36 
GeneralRe: Storing RichText data in Access Database Field Pin
bjulien12-Feb-04 10:25
bjulien12-Feb-04 10:25 
GeneralExplicit abstract methods. Pin
krisp11-Feb-04 15:29
krisp11-Feb-04 15:29 
GeneralRe: Explicit abstract methods. Pin
Kentamanos11-Feb-04 15:52
Kentamanos11-Feb-04 15:52 
GeneralRe: Explicit abstract methods. Pin
krisp11-Feb-04 16:21
krisp11-Feb-04 16:21 
GeneralRe: Explicit abstract methods. Pin
Kentamanos11-Feb-04 16:45
Kentamanos11-Feb-04 16:45 
GeneralRe: Explicit abstract methods. Pin
krisp11-Feb-04 17:06
krisp11-Feb-04 17:06 
Ok, well this is pretty much exactly what i want to do with an abstract method.

public class DataBase
{
...
}

public class BaseClass
{
protected abstract DataBase DoMethod();
}

public class DataChild : DataBase
{
...
}

public class ChildClass : BaseClass
{
private int _MyInt = 6;

protected override DataBase BaseClass.DoMethod()
{
return DoMethod();
}

public DataChild DoMethod()
{
return new DataChild();
}
}

I am returning an object in my child's method that derives from the object being returned in my base's method.

So, this would not have any problems that I can see.

I don't see how this has anything to do with multiple inheritance, because I would still only be inheriting from one class. There is no reason why the return value can't be derived from the abstract method's return type.

I can not see in any way this conflicting with any multiple inheritance, or anything.

That way when the object is casted to its base class, the proper return type is still received.

What am I missing for this not to work?
GeneralRe: Explicit abstract methods. Pin
Kentamanos11-Feb-04 17:41
Kentamanos11-Feb-04 17:41 
GeneralFile Backup Pin
Demo36011-Feb-04 14:50
Demo36011-Feb-04 14:50 
GeneralRe: File Backup Pin
Heath Stewart12-Feb-04 3:31
protectorHeath Stewart12-Feb-04 3:31 
GeneralRe: File Backup Pin
Anonymous16-Feb-04 5:53
Anonymous16-Feb-04 5:53 
GeneralRe: File Backup Pin
Demo36016-Feb-04 7:33
Demo36016-Feb-04 7:33 
GeneralRe: File Backup Pin
Heath Stewart16-Feb-04 8:50
protectorHeath Stewart16-Feb-04 8:50 
GeneralSurround Sound speaker localization Pin
Matt Frear11-Feb-04 13:00
Matt Frear11-Feb-04 13:00 
GeneralRe: Surround Sound speaker localization Pin
Heath Stewart12-Feb-04 3:28
protectorHeath Stewart12-Feb-04 3:28 
GeneralRe: Surround Sound speaker localization Pin
Matt Frear16-Feb-04 11:11
Matt Frear16-Feb-04 11:11 
Generalclose button on control box of form Pin
visiontec11-Feb-04 11:34
visiontec11-Feb-04 11:34 
GeneralRe: close button on control box of form Pin
Heath Stewart11-Feb-04 12:18
protectorHeath Stewart11-Feb-04 12:18 
GeneralOpinions needed on Win Form Design Pin
MrJJKoolJ11-Feb-04 11:29
MrJJKoolJ11-Feb-04 11:29 
GeneralRe: Opinions needed on Win Form Design Pin
Heath Stewart11-Feb-04 12:15
protectorHeath Stewart11-Feb-04 12:15 
GeneralRe: Opinions needed on Win Form Design Pin
MrJJKoolJ11-Feb-04 14:18
MrJJKoolJ11-Feb-04 14:18 
GeneralRe: Opinions needed on Win Form Design Pin
Heath Stewart12-Feb-04 3:26
protectorHeath Stewart12-Feb-04 3:26 
GeneralSetting Properties through .Net Remoting Pin
Brian Rogan11-Feb-04 11:09
Brian Rogan11-Feb-04 11:09 
Generalproblem with XmlDocument Pin
visiontec11-Feb-04 10:50
visiontec11-Feb-04 10:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.