Professional Documents
Culture Documents
007 Properties in C Example
007 Properties in C Example
* Properties in C# Example
*
*************************************************************************/
using System;
namespace MyProject.Examples
{
public class Book
{
private int _id;
private string _bookName;
private int _noOfPAges=250;
private string _auther;
public int Id
{
set
{
if (value < 0)
throw new Exception("Id not valid");
this._id = value;
}
get {
return this._id;
}
}
class ExampleOne
{
public static void Main()
{