Skip to content

Commit 99500bd

Browse files
committed
More changes
1 parent c918a92 commit 99500bd

File tree

5 files changed

+53
-1
lines changed

5 files changed

+53
-1
lines changed

Animal.cs

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System;
2+
namespace Learning_Git
3+
{
4+
public class Animal :IAnimal
5+
{
6+
public Animal()
7+
{
8+
Console.WriteLine("Inside Animal constructor");
9+
}
10+
11+
public bool CanBreath()
12+
{
13+
Console.WriteLine("Animal can breath");
14+
return true;
15+
}
16+
17+
public bool IsAlive()
18+
{
19+
Console.WriteLine("Animal can be alive");
20+
return true;
21+
}
22+
}
23+
}

Cat.cs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System;
2+
namespace Learning_Git
3+
{
4+
public class Cat : Animal
5+
{
6+
public Cat()
7+
{
8+
Console.WriteLine("Inside Cat constructor");
9+
}
10+
11+
12+
}
13+
}

IAnimal.cs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using System;
2+
namespace Learning_Git
3+
{
4+
public interface IAnimal
5+
{
6+
bool CanBreath();
7+
bool IsAlive();
8+
9+
10+
}
11+
}

Learning_Git.csproj

+3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
<ItemGroup>
3535
<Compile Include="Program.cs" />
3636
<Compile Include="Properties\AssemblyInfo.cs" />
37+
<Compile Include="IAnimal.cs" />
38+
<Compile Include="Cat.cs" />
39+
<Compile Include="Animal.cs" />
3740
</ItemGroup>
3841
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
3942
</Project>

Program.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ class MainClass
66
{
77
public static void Main(string[] args)
88
{
9-
Console.WriteLine("Hello World!");
9+
IAnimal cat = new Cat();
10+
cat.CanBreath();
11+
1012
//See if this works
1113
}
1214
}

0 commit comments

Comments
 (0)