| |

VerySource

 Forgot password?
 Register
Search
View: 794|Reply: 5

Seeking the writing, implementation and calling of an interface

[Copy link]

1

Threads

4

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-1-4 23:20:01
| Show all posts |Read mode
I am very grateful for the writing, implementation method and calling source code of an interface, thank you very much!
Reply

Use magic Report

0

Threads

15

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-1-6 12:51:01
| Show all posts
//testInterface.cs define an interface
interface IDBAccess
{
       void Delelte ();
     void Update ();
}

OracleDBAccess: IDBAccess /// implement the interface
{
   void Delete ()
   {}
    void Update ()
    {}
}

public static int Main ()
{
   IDBAccess db = new OracleDBAccess ();
db.Delete ();
}
Reply

Use magic Report

1

Threads

4

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-8-4 09:45:01
| Show all posts
How to call if the interface and the program calling it are not in the same file?

For example, if the interface is a file, the method for implementing the interface is another file, and the program that calls the interface is in another file, can this be achieved? I always can't achieve it. Please scare everyone to help, thank you!
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-4 12:00:01
| Show all posts
Added namespace.
Reply

Use magic Report

0

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-8-4 12:45:02
| Show all posts
Add reference
Add namespace
Realize the interface likeklongvvagain.
Reply

Use magic Report

1

Threads

4

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-8-5 06:30:01
| Show all posts
Always report the following errors



Error 1'FCKEditorExampleForWeb.OracleDBAccess' does not implement interface member'FCKEditorExampleForWeb.IDBAccess.show()'.'FCKEditorExampleForWeb.OracleDBAccess.show()' is either static, not public, or has the wrong return type. E:\showWeb2.0\FCKEditorExampleForWeb\FCKEditor2ForWebClassForWeb .cs 13 11 FCKEditorExampleForWeb
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list