-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
139 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<RootNamespace>practical_01</RootNamespace> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
</Project> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.12.35323.107 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "practical-01", "practical-01.csproj", "{7453CE89-9890-4239-978B-5D015A258709}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{7453CE89-9890-4239-978B-5D015A258709}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{7453CE89-9890-4239-978B-5D015A258709}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{7453CE89-9890-4239-978B-5D015A258709}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{7453CE89-9890-4239-978B-5D015A258709}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {081D5BAF-0BAE-4EAC-A7CE-FCD1A65F8F10} | ||
EndGlobalSection | ||
EndGlobal |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// from A to B and C | ||
|
||
interface iUser | ||
{ | ||
void getDetails(string x); | ||
} | ||
|
||
class User : iUser | ||
{ | ||
public void getDetails(string name) | ||
{ | ||
Console.WriteLine("My name is {0}", name); | ||
} | ||
} | ||
|
||
class User2 : iUser | ||
{ | ||
public void getDetails(string address) | ||
{ | ||
Console.WriteLine("My address is {0}", address); | ||
} | ||
} | ||
|
||
class Program | ||
{ | ||
static void Main() | ||
{ | ||
iUser u = new User(); | ||
u.getDetails("John Doe"); | ||
|
||
iUser u2 = new User2(); | ||
u2.getDetails("123 Main St"); | ||
} | ||
} | ||
|
||
// from A and B to C | ||
interface iUser | ||
{ | ||
void getName(string x); | ||
} | ||
|
||
interface iAddress | ||
{ | ||
void getAddress(string a); | ||
} | ||
|
||
class User : iUser, iAddress | ||
{ | ||
public void getName(string name) | ||
{ | ||
Console.WriteLine("My name is {0}", name); | ||
} | ||
public void getAddress(string address) | ||
{ | ||
Console.WriteLine("My address is {0}", address); | ||
} | ||
} | ||
|
||
class Program | ||
{ | ||
static void Main() | ||
{ | ||
User u = new User(); | ||
u.getName("John Doe"); | ||
u.getAddress("123 Main St"); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.12.35323.107 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "interfaceEg", "interfaceEg.csproj", "{DACE2A75-8794-4CFE-9D51-EDFB6EDF83E6}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{DACE2A75-8794-4CFE-9D51-EDFB6EDF83E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{DACE2A75-8794-4CFE-9D51-EDFB6EDF83E6}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{DACE2A75-8794-4CFE-9D51-EDFB6EDF83E6}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{DACE2A75-8794-4CFE-9D51-EDFB6EDF83E6}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {D4A1F73A-68EB-4F0C-9BCF-B0C83FE6D132} | ||
EndGlobalSection | ||
EndGlobal |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.