This file contains 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
using System; | |
namespace MyLibrary | |
{ | |
public class Employee | |
{ | |
public string FirstName { get; set; } | |
public string LastName { get; set; } | |
public bool IsFullTime { get; set; } | |
public Employee(string firstName, string lastName, bool isFullTime = true) | |
{ | |
Console.WriteLine("Inside Employee constructor. isFullTime should default to true."); | |
FirstName = firstName; | |
LastName = lastName; | |
IsFullTime = isFullTime; | |
} | |
} | |
} |
This file contains 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
using System; | |
namespace MyLibrary | |
{ | |
public class Employee | |
{ | |
public string FirstName { get; set; } | |
public string LastName { get; set; } | |
public bool IsFullTime { get; set; } | |
public Employee(string firstName, string lastName, bool isFullTime = false) | |
{ | |
FirstName = firstName; | |
LastName = lastName; | |
IsFullTime = isFullTime; | |
} | |
} | |
} |
This file contains 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
using MyLibrary; | |
using System; | |
namespace MyApp | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var employee = new Employee("Jane", "Doe"); // Use the default parameter | |
Console.WriteLine($"Name: {employee.FirstName} {employee.LastName}; Full Time: {employee.IsFullTime}"); | |
Console.ReadKey(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment