The modifier 'static' is not valid for this item / Static interface error in c# -
this question has answer here:
how can implement static methods in interface...?
public interface icache { //get item cache static object get(string pname); //check item exist in cache static bool contains(string pname); //add item cache static void add(string pname, object pvalue); //remove item cache static void remove(string pname); } the above interface throws error: the modifier 'static' not valid item
you can't it. should be
public interface icache { //get item cache object get(string pname); //check item exist in cache bool contains(string pname); //add item cache void add(string pname, object pvalue); //remove item cache void remove(string pname); } check out why doesn't c# allow static methods implement interface?
also eric lippert wrote cool article series called
Comments
Post a Comment