Click here to Skip to main content
15,886,032 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
The below program is based on an interface.
I am going to project--->add class--->interface
C#
interface Interface1
{
int add(int x, int y);
}

next
project--->add class
now

C#
class Class1 : interface1
{
    public int add(int x,int y)
}

In the form I am taking two text boxes and one button.

In that am declaring only Class1 obj=new Class1(). I have a doubt in this line about how it will excute.
C#
{
private button event
{
MessageBox.show
Posted
Updated 16-Apr-13 20:21pm
v3
Comments
[no name] 17-Apr-13 2:13am    
Hi,

can you post full code
Manfred Rudolf Bihy 17-Apr-13 2:24am    
Use code tags to format your code properly.
Use proper nouns for class names (they should start with a capital letter).
Your method definition in Class1 is wrong as there is no body to the method add(int x, int y).
The last code fragment is unintelligible and also missing some parts.

Please fix these things using the link Improve question under your question.

1 solution

The question makes no sense: it won't "execute", won't even compile.
It could be
C#
class1 myObject = new class1();


And it is irrelevant to interfaces and other content of the "question". I think you should rewind your learning process… somewhere near the very first page. Are you reading some manual, doing simple exercises? Excellent! Now go to the very beginning of the classes chapter. No questions could possibly help you more than that.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900