Created
September 13, 2013 15:34
-
-
Save prio101/6552274 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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