These codes are really boring and tasting () give me an error !!! Can you rearrange these codes?
class program {static void main (string [] args) {string [] arraystr = {"yusuf", "mehmet"}; Iit myitems = new Ilist (arraystr); Selected items list slit = new selected item list (); Slist.Items.Add (myitems); Console.Write (slist.Items [0] .toString ()); Console.ReadKey (); }} Public class Ilist {Private string [] advertising; Public Ilist (string [] advertising) {Advertising = Advertisement; } Public override string [] ToString () {return.Ad; }} Public category selected item list {public list items; Public selected topic list () {items = new list (); }}
Error:
Generics_List_with_Class.Ilist.ToString () ': return type must be' string 'override member' to match the object. Toastring ()
Rename Ilist.ToString ()
To ToStringArray ()
. All objects have a toasting ()
method but you are overriding it with some other type of return with a function, which can cause your error.
There is no good name for the IList class, because in the conference it is said that names starting with "I" should be an interface. I suggest that the list should look like this:
public class stringlists {personal string} advertising; Public stringlists (string [] advertising) {ad = advertisement; } Public string [] ToStringArray () {return.Ad; } Public override toasting () {return string .join (",", advertisement); }}
To be honest, I recommend that you eat this whole point of view and use it instead.
Comments
Post a Comment