Click here to Skip to main content
15,886,963 members
Home / Discussions / C#
   

C#

 
AnswerRe: NUnit test framework Pin
Pete O'Hanlon3-Apr-13 20:21
mvePete O'Hanlon3-Apr-13 20:21 
GeneralRe: NUnit test framework Pin
User 5838523-Apr-13 20:43
User 5838523-Apr-13 20:43 
AnswerRe: NUnit test framework Pin
Abhinav S3-Apr-13 20:30
Abhinav S3-Apr-13 20:30 
AnswerRe: NUnit test framework Pin
Bernhard Hiller3-Apr-13 21:18
Bernhard Hiller3-Apr-13 21:18 
AnswerRe: NUnit test framework Pin
BobJanova3-Apr-13 23:31
BobJanova3-Apr-13 23:31 
AnswerRe: NUnit test framework Pin
Keith Barrow4-Apr-13 1:55
professionalKeith Barrow4-Apr-13 1:55 
AnswerRe: NUnit test framework Pin
jschell4-Apr-13 9:15
jschell4-Apr-13 9:15 
Questionuse a class methode that implements and interface from another class Pin
tux@ddictor3-Apr-13 7:49
tux@ddictor3-Apr-13 7:49 
hi everybody
am trying to understand interfaces .and i created a Console App with Two Classes( Somme and Tunnel) and an Interface called IAdd.

IAdd interface:
C#
interface IAdd
    {
        int calc(int a,int b);
    }


Somme Class that implement the IAdd interface:
C#
class Somme :  IAdd
   {
       public int calc(int a, int b)
       {
           return a + b;
       }
   }


Tunnel Class :
C#
class Tunnel
   {
       IAdd som = new Somme();
       som.calc(3,4);//this code s not accepted by VS.i wrote it here just to show at what level i have a problem
   }

but the MAin Console can use this writing.why i can't calculate the Somme and then send the result to the main Console.

Console Main:
C#
static void Main(string[] args)
       {
           IAdd som = new Somme();
           int x = som.calc(3, 4);
           Console.WriteLine( x);
           Console.ReadKey();
       }


what's the point am missing here?

forget my english,am doing my best to learn many things .
AnswerRe: use a class methode that implements and interface from another class Pin
tux@ddictor3-Apr-13 7:53
tux@ddictor3-Apr-13 7:53 
QuestionC# Pin
sanjugen3-Apr-13 0:07
sanjugen3-Apr-13 0:07 
AnswerRe: C# Pin
cursore843-Apr-13 0:31
cursore843-Apr-13 0:31 
AnswerRe: C# Pin
Simon_Whale3-Apr-13 0:58
Simon_Whale3-Apr-13 0:58 
AnswerRe: C# Pin
Abhinav S3-Apr-13 3:13
Abhinav S3-Apr-13 3:13 
Questiongoogle calendar api .net Pin
cursore842-Apr-13 23:06
cursore842-Apr-13 23:06 
QuestionRe: google calendar api .net Pin
Eddy Vluggen3-Apr-13 6:57
professionalEddy Vluggen3-Apr-13 6:57 
AnswerRe: google calendar api .net Pin
cursore843-Apr-13 7:34
cursore843-Apr-13 7:34 
AnswerRe: google calendar api .net Pin
Eddy Vluggen3-Apr-13 8:40
professionalEddy Vluggen3-Apr-13 8:40 
GeneralRe: google calendar api .net Pin
cursore843-Apr-13 9:30
cursore843-Apr-13 9:30 
GeneralRe: google calendar api .net Pin
Eddy Vluggen3-Apr-13 22:41
professionalEddy Vluggen3-Apr-13 22:41 
QuestionImpoting Dataview to Doc Pin
vpasuleti2-Apr-13 20:29
vpasuleti2-Apr-13 20:29 
AnswerRe: Impoting Dataview to Doc Pin
Richard MacCutchan2-Apr-13 22:03
mveRichard MacCutchan2-Apr-13 22:03 
AnswerRe: Impoting Dataview to Doc Pin
Abhinav S3-Apr-13 3:16
Abhinav S3-Apr-13 3:16 
Questionobject reference not set to an instance of an object Pin
surya 20132-Apr-13 18:50
surya 20132-Apr-13 18:50 
AnswerRe: object reference not set to an instance of an object Pin
Chinmaya C2-Apr-13 19:24
Chinmaya C2-Apr-13 19:24 
QuestionRe: object reference not set to an instance of an object Pin
surya 20132-Apr-13 22:31
surya 20132-Apr-13 22:31 

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.