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

C#

 
GeneralRe: hello Pin
Pete O'Hanlon4-Apr-13 5:09
mvePete O'Hanlon4-Apr-13 5:09 
GeneralRe: hello Pin
youshy4-Apr-13 6:54
youshy4-Apr-13 6:54 
GeneralRe: hello Pin
Keith Barrow4-Apr-13 5:15
professionalKeith Barrow4-Apr-13 5:15 
GeneralRe: hello Pin
youshy4-Apr-13 6:53
youshy4-Apr-13 6:53 
QuestionUSB devices, WMI and C# Pin
MarkB7774-Apr-13 0:22
MarkB7774-Apr-13 0:22 
AnswerRe: USB devices, WMI and C# Pin
Kenneth Haugland4-Apr-13 1:24
mvaKenneth Haugland4-Apr-13 1:24 
QuestionRock_Monu import a doc file in sql...??? Pin
rock_monu3-Apr-13 21:49
rock_monu3-Apr-13 21:49 
QuestionRe: Rock_Monu import a doc file in sql...??? Pin
Richard MacCutchan3-Apr-13 22:08
mveRichard MacCutchan3-Apr-13 22:08 
QuestionNUnit test framework Pin
User 5838523-Apr-13 16:34
User 5838523-Apr-13 16:34 
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 

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.