0

How exactly would I go about doing the following in C#?

public class Test {
    public static void main(String[] args) {
        Test(new TestInterface() {
            @Override
            public void SomeMethod() {
                //create instance of the interface within parameters of a method.
            }       
        });
    }

    public static void Test(TestInterface _interface) {

    }
}

public interface TestInterface {
    public void SomeMethod();
}

I'm not entirely sure how to explain this in words, so I decided to use this example.

Thanks!

Edited by Jaydenn

1
Contributor
1
Reply
3
Views
4 Years
Discussion Span
Last Post by Jaydenn
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.