Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

virtual and override #1114

Closed
N0zzy opened this issue May 26, 2023 · 1 comment
Closed

virtual and override #1114

N0zzy opened this issue May 26, 2023 · 1 comment

Comments

@N0zzy
Copy link

N0zzy commented May 26, 2023

image

I apologize for stupid questions. there is such an example with the result of a pie.
below are methods with "signature" virtual.
How can I change to "override" and is it possible?

@jakubmisek
Copy link
Member

override is on overridden methods (https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/override).

You cannot "change" it to override. To define an overriden method, you have to override a virtual method:

class A {
  function foo() {/* do somethig */} // public virtual void foo()
}
class B extends A {
  function foo() {/* do something else */} // public override void foo()
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants