Click here to Skip to main content
15,914,500 members
Home / Discussions / C#
   

C#

 
GeneralRe: Reg Ex Pin
Aslesh4-Sep-08 6:38
Aslesh4-Sep-08 6:38 
GeneralRe: Reg Ex Pin
Guffa4-Sep-08 6:47
Guffa4-Sep-08 6:47 
GeneralRe: Reg Ex Pin
Kythen4-Sep-08 7:17
Kythen4-Sep-08 7:17 
GeneralRe: Reg Ex Pin
Wendelius4-Sep-08 10:40
mentorWendelius4-Sep-08 10:40 
AnswerRe: Reg Ex Pin
leppie4-Sep-08 8:55
leppie4-Sep-08 8:55 
GeneralRe: Reg Ex Pin
Guffa4-Sep-08 13:16
Guffa4-Sep-08 13:16 
GeneralRe: Reg Ex Pin
leppie4-Sep-08 16:33
leppie4-Sep-08 16:33 
Questionhow i can call code C++ from C# ???? Pin
jhugox4-Sep-08 5:58
jhugox4-Sep-08 5:58 
AnswerRe: how i can call code C++ from C# ???? Pin
Mark Salsbery4-Sep-08 6:58
Mark Salsbery4-Sep-08 6:58 
QuestionBest way to display FAQ's in window application Pin
lune124-Sep-08 5:21
lune124-Sep-08 5:21 
AnswerRe: Best way to display FAQ's in window application Pin
Pete O'Hanlon4-Sep-08 5:26
mvePete O'Hanlon4-Sep-08 5:26 
AnswerRe: Best way to display FAQ's in window application Pin
Ravi Bhavnani4-Sep-08 5:54
professionalRavi Bhavnani4-Sep-08 5:54 
QuestionStatus of hardware device Pin
vinay_K4-Sep-08 5:18
vinay_K4-Sep-08 5:18 
AnswerRe: Status of hardware device Pin
Ravi Bhavnani4-Sep-08 5:50
professionalRavi Bhavnani4-Sep-08 5:50 
Questioncheck if a form is open Pin
fghdmhmmd4-Sep-08 4:56
fghdmhmmd4-Sep-08 4:56 
AnswerRe: check if a form is open Pin
zafersavas4-Sep-08 9:15
zafersavas4-Sep-08 9:15 
AnswerRe: check if a form is open Pin
Wendelius4-Sep-08 11:14
mentorWendelius4-Sep-08 11:14 
GeneralRe: check if a form is open Pin
fghdmhmmd5-Sep-08 1:05
fghdmhmmd5-Sep-08 1:05 
QuestionInterface Inheritance Pin
Aslesh4-Sep-08 4:28
Aslesh4-Sep-08 4:28 
AnswerRe: Interface Inheritance Pin
DaveyM694-Sep-08 4:37
professionalDaveyM694-Sep-08 4:37 
GeneralRe: Interface Inheritance Pin
Aslesh4-Sep-08 4:42
Aslesh4-Sep-08 4:42 
GeneralRe: Interface Inheritance Pin
DaveyM694-Sep-08 4:49
professionalDaveyM694-Sep-08 4:49 
GeneralRe: Interface Inheritance Pin
Aslesh4-Sep-08 4:57
Aslesh4-Sep-08 4:57 
GeneralRe: Interface Inheritance Pin
Robert.C.Cartaino4-Sep-08 5:18
Robert.C.Cartaino4-Sep-08 5:18 
Try this and see if the previous answer makes any more sense:

using System;

interface IA
{ 
<code>    // There is no code here. Just a "requirement" that you need
    // to implement a method called CodeProject().</code>
    void CodeProject();
}

interface IB
{
<code>    // IB also says that you are required to implement a method called CodeProject().</code>
    void CodeProject();
}

public class Code : IA, IB
{
<code>    // By inheriting from IA (or IB), what you are saying is that 
    // you are required to implement a method called CodeProject().
    // IA and IB just happen to have the same requirement.
    // Here it is.</code>
    public void CodeProject()
    {
        Console.WriteLine("This is the CodeProject() method.");
    }
}

class Program
{
    static void Main(string[] args)
    {
        Code c = new Code();
        c.CodeProject();
    }
}


A couple of quick notes:

Interfaces are named with a leading letter "I", by convention (for example, IDisposable).

Methods defined in interfaces are automatically public. You cannot use the public modifier in the interface/method definition.

Enjoy,

Robert C. Cartaino
GeneralRe: Interface Inheritance Pin
Robert.C.Cartaino4-Sep-08 5:19
Robert.C.Cartaino4-Sep-08 5:19 

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.