C# cannot convert method to non delegate type

后端 未结 7 1817
猫巷女王i
猫巷女王i 2020-12-08 07:12

I have a class called Pin.

public class Pin
{
    private string title;

    public Pin() { }

    public setTitle(string title) {
        this.         


        
7条回答
  •  -上瘾入骨i
    2020-12-08 07:14

    To execute a method you need to add parentheses, even if the method does not take arguments.

    So it should be:

    string t = obj.getTitle();
    

提交回复
热议问题