KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a class and an interface, and when I try to instantiate the interface, I get an error: Cannot create an instance of the abstract class or interface My code is below: namespace MyNamespace { public interface IUser { int Property1 { get; set; } string Property2 { get; set; } string Property3 { get; set; } void GetUser(); } public class User : IUser { public int Property1 { get; set; } public string Property2 { get; set; } public string Property3 { get; set; } public void GetUser() { //some logic here...... } } } When I try to instantiate IUser user = new IUser(); I get an error: Cannot create an instance of the abstract class or interface What am I doing wrong here?
Tags (comma-separated)
Save Edits
Cancel