D
D
DD-var2020-08-26 04:34:06
C++ / C#
DD-var, 2020-08-26 04:34:06

How to make a method in Interface?

I am studying version 8. I am creating a project on the Net Framework. The question arose how to write a method in the Interface, so that I can call it later? I am writing a method, error CS8701 appears.
Error CS8701 Target runtime doesn't support default interface implementation.

int desk(int u)
        {
            int result = size + u;
            return result;
        }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman, 2020-08-26
@DD-var

What is the version of dotnet? C# 8 is only available in Net Core 3 or in Net standard 2.1, Net framework classic supports Sharp version 7 at most

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question