Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

C# Getters and Setters

{
            title = aTitle;
            director = aDirector;
            Rating = aRating;
}
public string Rating
        {
            get { return rating; }
            set
            {
                if(value == "G" || value == "PG" || value == "PG13" || value =="R" || value == "NR")
                {
                    rating = value;
                } else
                {
                    rating = "NR";
                }
            }
        }        
Source by # #
 
PREVIOUS NEXT
Tagged: #Getters #Setters
ADD COMMENT
Topic
Name
4+5 =