32
1
using System;
2
3
public class Program
4
{
5
6
public class Person{
7
8
public string FirstName { get;set;} ="First";
9
public string LastName { get;set;} = "Last";
10
public string Email { get;set;} = "name@email.com";
11
}
12
13
14
public static void Main()
15
{
16
17
18
Person p = new Person();
19
20
Console.WriteLine($"{p.FirstName} {p.LastName}'s email address is {p.Email}");
21
22
p = new Person()
23
{
24
FirstName= "Amal",
25
LastName = "Dev"
26
};
27
Console.WriteLine("\nModifiying Default values");
28
Console.WriteLine($"{p.FirstName} {p.LastName}'s email address is {p.Email}");
29
}
30
31
32
}
Cached Result
Compilation error (line 10, col 16): Cannot convert type 'bool' to 'int'