Created
October 28, 2019 03:41
-
-
Save kunjee17/d8904f48662ae93dcf28953522758d8c to your computer and use it in GitHub Desktop.
Normal Person in C#
This file contains hidden or 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
class Person { | |
private readonly string firstName; | |
private readonly string lastName; | |
public Person(string firstName, string lastName) { | |
this.firstName = firstName; | |
this.lastName = lastName; | |
} | |
public string FirstName { get {return this.firstName; } } | |
public string LastName { get {return this.lastName; } } | |
private string calculateFullName() { | |
return this.firstName + " " + this.lastName; | |
} | |
public string FullName { get {return this.calculateFullName(); } } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment