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
//Sample A | |
public enum UserType | |
{ | |
Admin, | |
User | |
} | |
//To verify a seting | |
if (userType == UserType.Admin) | |
{ |
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
//To verify a seting | |
if (userType == "Admin") | |
{ | |
IsAdmin = true; | |
} | |
//Or To define a Process inside a function | |
if (process == "CreditExtension") | |
{ | |
calculateInterest = true; |
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
public int Age | |
{ | |
get { return age_; } | |
set { | |
if (value > 0 && value < 120) | |
age_ = value; | |
} | |
} | |
public string Address |
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
public class Person | |
{ | |
private string name_; | |
private int age_; | |
private string address_; | |
public string Address | |
{ get { return address_; } | |
set { address_ = value;} | |
} |
NewerOlder