Overload finally
This commit is contained in:
parent
8a1b696755
commit
0aa442271f
11 changed files with 150 additions and 2 deletions
10
Emne 3/MiniOverloadsOppgave/MiniOverloadsOppgave.sln
Normal file
10
Emne 3/MiniOverloadsOppgave/MiniOverloadsOppgave.sln
Normal 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
|
|
@ -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>
|
23
Emne 3/MiniOverloadsOppgave/MiniOverloadsOppgave/Program.cs
Normal file
23
Emne 3/MiniOverloadsOppgave/MiniOverloadsOppgave/Program.cs
Normal 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");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue