© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
5 replies
Makian

Interfaces

Having issues with properly implementing interface property
public interface Item {
    public int durability { get; protected set; }
    public int maxDurability { get; protected set; }
}
public interface Item {
    public int durability { get; protected set; }
    public int maxDurability { get; protected set; }
}

public class Magazine : Item {
    public int durability { get => 1; protected set { } }
    public int maxDurability { get => 1; protected set { } }
}
public class Magazine : Item {
    public int durability { get => 1; protected set { } }
    public int maxDurability { get => 1; protected set { } }
}

Errors:
'Magazine' does not implement interface member 'Item.durability.set'. 'Magazine.durability.set' is not public
'Magazine' does not implement interface member 'Item.durability.set'. 'Magazine.durability.set' is not public

'Magazine' does not implement interface member 'Item.maxDurability.set'. 'Magazine.maxDurability.set' is not public
'Magazine' does not implement interface member 'Item.maxDurability.set'. 'Magazine.maxDurability.set' is not public
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

C# interfaces
C#CC# / help
2y ago
Generic Interfaces
C#CC# / help
3y ago
❔ C# Interfaces
C#CC# / help
3y ago
✅ understanding interfaces
C#CC# / help
3y ago