Initializing Property in Constructor C# with Example



Initializing Property in Constructor C# with Example

class Example 
{ 
public string Foobar { get; set; } 
public List Names { get; set; } 
public Example() 
{ 
Foobar = "xyz"; 
Names = new List(){"carrot","fox","ball"}; 
} 
} 
 

interface 

0 Comment's

Comment Form

Submit Comment