Overload finally

This commit is contained in:
Geir Okkenhaug Jerstad 2024-11-27 09:43:48 +01:00
parent 8a1b696755
commit 0aa442271f
11 changed files with 150 additions and 2 deletions

View file

@ -0,0 +1,10 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
EndGlobalSection
EndGlobal

View file

@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View file

@ -0,0 +1,23 @@
namespace MiniOverloadsOppgave
{
class Welcome
{
void PrintWelcomeMessage()
{
Console.WriteLine("Hei og velkommen!");
}
void PrintWelcomeMessage(string kompliment = "Du er Snill")
{
Console.WriteLine($"Hei og velkommen! {kompliment}");
}
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
= PrintWelcomeMessage();
PrintWelcomeMessage("Du er nokså snill");
}
}
}