Constructor
This commit is contained in:
parent
96c1b52110
commit
250764b7ef
|
@ -2,10 +2,16 @@ namespace StaticogIkkestatic;
|
|||
|
||||
public class Places
|
||||
{
|
||||
public string PlaceName;
|
||||
public string Municipality;
|
||||
public string Region;
|
||||
public string PlaceName { get; private set; }
|
||||
public string Municipality{ get; private set; }
|
||||
public string Region{ get; private set; }
|
||||
|
||||
public Places(string placeName, string municipality, string region)
|
||||
{
|
||||
PlaceName = placeName;
|
||||
Municipality = municipality;
|
||||
Region = region;
|
||||
}
|
||||
public void ShowPlace()
|
||||
{
|
||||
var labelWidth = 8;
|
||||
|
|
|
@ -4,15 +4,11 @@
|
|||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
var place = new Places();
|
||||
place.PlaceName = "Stavern";
|
||||
place.Municipality = "Larvik";
|
||||
place.Region = "Vestfold";
|
||||
var place = new Places( "Stavern","Larvik", "Vestfold");
|
||||
|
||||
var place2 = new Places("Rjukan","Tinn","Telemark");
|
||||
|
||||
place.ShowPlace();
|
||||
var place2 = new Places();
|
||||
place2.PlaceName = "Rjukan";
|
||||
place2.Municipality = "Tinn";
|
||||
place2.Region = "Telemark";
|
||||
place2.ShowPlace();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue