user defined type
examples for user defined type in c#???
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ravi KumarPosted Aug 19, 2014, 8:19 AM
You can create an User Defined Datatype Students like this:
public class Students
{
private string _rollno;
private string _name;
public string rollno
{
get
{
return _rollno;
}
set
{
_rollno = value;
}
}
public string name
{
get
{
return _name;
}
set
{
_name = value;
}
}
}
You can use the class, like this:
Students s = new Students();
s.rollno = "S001";
s.name = "Ram";
Ravi KumarPosted Aug 20, 2014, 12:08 AM
VulpesPosted Aug 19, 2014, 9:03 AM
Even apparently built-in types in C# such as object, int, bool are just aliases for the .NET framework types: System.Object, System.Int32 and System.Boolean respectively.
Ankur JainPosted Aug 19, 2014, 8:46 AM
Here is the example with structure...
Najna AbdullaPosted Aug 19, 2014, 8:30 AM
Najna AbdullaPosted Aug 19, 2014, 8:30 AM
Najna AbdullaPosted Aug 19, 2014, 8:30 AM