Click here to Skip to main content
15,927,174 members
Home / Discussions / C#
   

C#

 
GeneralRe: is there any decryption algorithm that uses a dictionary to decrypt an encrypted algorithm??? Pin
Tim Craig11-May-09 12:11
Tim Craig11-May-09 12:11 
AnswerRe: is there any decryption algorithm that uses a dictionary to decrypt an encrypted algorithm??? Pin
Ha lee15-May-09 18:04
Ha lee15-May-09 18:04 
AnswerRe: is there any decryption algorithm that uses a dictionary to decrypt an encrypted algorithm??? Pin
Ha lee5-May-09 14:47
Ha lee5-May-09 14:47 
QuestionPropertyGrid and Custom properties Pin
Mark F.3-May-09 14:07
Mark F.3-May-09 14:07 
AnswerRe: PropertyGrid and Custom properties Pin
Member 44703544-May-09 0:55
Member 44703544-May-09 0:55 
QuestionRe: PropertyGrid and Custom properties Pin
Mark F.4-May-09 5:55
Mark F.4-May-09 5:55 
AnswerRe: PropertyGrid and Custom properties Pin
Member 44703544-May-09 23:54
Member 44703544-May-09 23:54 
QuestionHow can I make a method abstract in a child class? Pin
Meysam Mahfouzi3-May-09 11:47
Meysam Mahfouzi3-May-09 11:47 
public abstract class Base
{
    public int GetInt()
    {
        return 1;
    }
}

public abstract class AbstractChild : Base
{
    public abstract int GetInt();
}

public class Child : AbstractChild
{
    public override int GetInt()
    {
        return 2;
    }
}


I want all implementers of AbstractChild to implement GetInt method. So, I decide to make the method abstract even though it's not originally abstract in the Base class. Then I implement it in the Child class. But when I execute the following code, it surprisingly returns 1:

Base b = new Child();
Console.Out.WriteLine(b.GetInt());// prints 1


Since b is of type Child, I would normally expect the overridden method in Child class to be called. Why is the method in base class being called? Am I misunderstanding something?
AnswerRe: How can I make a method abstract in a child class? Pin
Henry Minute3-May-09 12:42
Henry Minute3-May-09 12:42 
AnswerRe: How can I make a method abstract in a child class? Pin
Alan N3-May-09 13:46
Alan N3-May-09 13:46 
GeneralRe: How can I make a method abstract in a child class? Pin
Meysam Mahfouzi3-May-09 18:24
Meysam Mahfouzi3-May-09 18:24 
GeneralRe: How can I make a method abstract in a child class? Pin
Alan N3-May-09 23:47
Alan N3-May-09 23:47 
GeneralRe: How can I make a method abstract in a child class? Pin
Meysam Mahfouzi4-May-09 2:22
Meysam Mahfouzi4-May-09 2:22 
GeneralRe: How can I make a method abstract in a child class? Pin
Alan N4-May-09 3:26
Alan N4-May-09 3:26 
GeneralRe: How can I make a method abstract in a child class? Pin
Meysam Mahfouzi4-May-09 4:05
Meysam Mahfouzi4-May-09 4:05 
GeneralRe: How can I make a method abstract in a child class? Pin
Alan N4-May-09 4:41
Alan N4-May-09 4:41 
QuestionUrgent Help With Serialization needed Pin
GrgBalden3-May-09 11:46
GrgBalden3-May-09 11:46 
AnswerRe: Urgent Help With Serialization needed Pin
Henry Minute3-May-09 12:39
Henry Minute3-May-09 12:39 
QuestionRe: Urgent Help With Serialization needed Pin
GrgBalden3-May-09 23:10
GrgBalden3-May-09 23:10 
AnswerRe: Urgent Help With Serialization needed Pin
Henry Minute4-May-09 1:33
Henry Minute4-May-09 1:33 
GeneralRe: Urgent Help With Serialization needed Pin
GrgBalden4-May-09 3:09
GrgBalden4-May-09 3:09 
GeneralRe: Urgent Help With Serialization needed Pin
Henry Minute4-May-09 4:10
Henry Minute4-May-09 4:10 
QuestionNeed some help fast:D [modified] Pin
DrJele3-May-09 7:32
DrJele3-May-09 7:32 
AnswerRe: Need some help fast:D Pin
Henry Minute3-May-09 8:46
Henry Minute3-May-09 8:46 
GeneralRe: Need some help fast:D Pin
Member 10339073-May-09 10:43
Member 10339073-May-09 10:43 

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.