Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Call Class Methods with Interface
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { interface Iinterface1 { int addition(int a, int b); int sub(int a, int b); } public class Class: Iinterface1 { public int addition(int a, int b) { Console.WriteLine(a+b); return a+b; } public int sub(int a, int b) { Console.WriteLine(a-b); return a-b; } } public class Program { public static void Main(string[] args) { //Your code goes here Console.WriteLine("Hello, world!"); Class c=new Class(); Iinterface1 i1=c; i1.addition(10,20); i1.sub(10,8); } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
T
How To Get Discord Nitro For Free
Split and Join
-Wall -std=c++14 -O0 -o a.out source_file.cpp
ToBase64String
sdfgyutresdf
ternary function
Two lines of Random number
Date format display
Search Element In Array-Recursive
Please log in to post a comment.