File tree 5 files changed +53
-1
lines changed
5 files changed +53
-1
lines changed Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change
1
+ using System ;
2
+ namespace Learning_Git
3
+ {
4
+ public interface IAnimal
5
+ {
6
+ bool CanBreath ( ) ;
7
+ bool IsAlive ( ) ;
8
+
9
+
10
+ }
11
+ }
Original file line number Diff line number Diff line change 34
34
<ItemGroup >
35
35
<Compile Include =" Program.cs" />
36
36
<Compile Include =" Properties\AssemblyInfo.cs" />
37
+ <Compile Include =" IAnimal.cs" />
38
+ <Compile Include =" Cat.cs" />
39
+ <Compile Include =" Animal.cs" />
37
40
</ItemGroup >
38
41
<Import Project =" $(MSBuildBinPath)\Microsoft.CSharp.targets" />
39
42
</Project >
Original file line number Diff line number Diff line change @@ -6,7 +6,9 @@ class MainClass
6
6
{
7
7
public static void Main ( string [ ] args )
8
8
{
9
- Console . WriteLine ( "Hello World!" ) ;
9
+ IAnimal cat = new Cat ( ) ;
10
+ cat . CanBreath ( ) ;
11
+
10
12
//See if this works
11
13
}
12
14
}
You can’t perform that action at this time.
0 commit comments