943,907 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 3800
  • C# RSS
Feb 5th, 2008
0

A property as a parameter in a constructor?

Expand Post »
I am supposed to write a custom exception handling constructor. First, I need to write a read/write string property and then I write the constructor that somehow needs to accept this property as a parameter (among other things such as msg and inner exception).

Any ideas? This is how it is worded on a homework by the way.
Thanks.
Last edited by Ratte; Feb 5th, 2008 at 7:23 pm.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
Ratte is offline Offline
38 posts
since Oct 2007
Feb 6th, 2008
0

Re: A property as a parameter in a constructor?

C# Syntax (Toggle Plain Text)
  1. class XYZ
  2. {
  3. string str;
  4. public string Str
  5. {
  6. get { return str; }
  7. set { str = value; }
  8. }
  9.  
  10. public XYZ(string str)
  11. {
  12. this.str = str;
  13. }
  14. }
Featured Poster
Reputation Points: 480
Solved Threads: 276
Postaholic
Ramy Mahrous is offline Offline
2,189 posts
since Aug 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: Hi
Next Thread in C# Forum Timeline: Salary calculation





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC