954,505 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

A property as a parameter in a constructor?

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.

Ratte
Light Poster
38 posts since Oct 2007
Reputation Points: 10
Solved Threads: 0
 
class XYZ
{
string str;
public string Str
{
get { return str; }
set { str = value; }
}

public XYZ(string str)
{
this.str = str;
}
}
Ramy Mahrous
Postaholic
2,196 posts since Aug 2006
Reputation Points: 480
Solved Threads: 276
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You