These Codes really boring. And Tostring() give me error !!! Can you rearrange these codes ?
class Program
{
static void Main(string[] args)
{
string[] arraystr = { "yusuf", "mehmet" };
Ilist myitems = new Ilist(arraystr);
SelectedItemsList slist = new SelectedItemsList();
slist.Items.Add(myitems);
Console.Write(slist.Items[0].ToString());
Console.ReadKey();
}
}
public class Ilist
{
private string[] Ad;
public Ilist(string[] ad)
{
Ad = ad;
}
public override string[] ToString()
{
return this.Ad;
}
}
public class SelectedItemsList
{
public List<Ilist> Items;
public SelectedItemsList()
{
Items = new List<Ilist>();
}
}
error : 'Generics_List_with_Class.Ilist.ToString()': return type must be 'string' to match overridden member 'object.ToString()'