I want to use this as default value of class method as this code:
public class Article { public int Id;//PK public String Author;//can be empty=anonymous public int? ToPublishDate; public String Summery; public String Content; public int RegDate; public Boolean Publish; private Boolean write(Article article=this,long position) { return true; } } but on this give me this error:
Default parameter value for 'article' must be compile-time constant.
Why this error occurs and how can I fix it?
someArticle.write(otherArticle, 1)implies it will actually involve thesomeArticleinstance in its execution in some way. IfsomeArticlenever gets involved beyond being the instance you call that method through, it should probably just beArticle.write(otherArticle, 1).