Question

X x As Styles Editing Dictate Nili A v Aav А А T Font Paragraph Styles Voice Q5. Consider the following code to answer the qu

b. ToString() has to be overridden to return the persons last and first names, which are displayed in the ListBox Donald Tru

0 0
Add a comment Improve this question Transcribed image text
Answer #1


public class Person
{
public string BDate,DDate,Country;
public string firstname;
public string lastname;
public Person(string birth,string fname,string lname,string cntry)
{
BDate=birth;
firstname=fname;
lastname=lname;
Country=cntry;
}
  
// (b) overriden ToString() method
public override string ToString()
{
return firstname+" "+lastname;
}
}


(a)

ListBox lstpersons=new ListBox();
lstpersons.Items.Add(new Person("15-01-2000","amar","kumar","india"));
// like this you can add

Add a comment
Know the answer?
Add Answer to:
X x As Styles Editing Dictate Nili A v Aav А А T Font Paragraph Styles...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT