Skip to content

Instantly share code, notes, and snippets.

@prio101
Created September 13, 2013 15:34
Show Gist options
  • Save prio101/6552274 to your computer and use it in GitHub Desktop.
Save prio101/6552274 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myclass.cs
{
class Program
{
static void Main(string[] args)
{
public MyClass
{
public raedonly string Name;
public int intVal;
public int val
{
get
{
return intVal;
}
set
{
if(value >= 0 && value<=10)
intVal = value;
else
throw(new ArgumentOutOfRangeException("val",value,"Val must be assigned a value between 0 and 10..."));
}
}
public override string ToString()
{
return "Name : "+Name+"\n Val : "+val;
}
private Myclass():this("Default Name")
{
}
public Myclass(string newName)
{
Name = newName;
intVal;
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment