Created
June 28, 2021 01:32
-
-
Save omayib/c9b85e5d875e85f7561e869ec543a4ea to your computer and use it in GitHub Desktop.
a code jam
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
namespace CodeChellange1 | |
{ | |
class Animal | |
{ | |
public void walk() | |
{ | |
Console.WriteLine("i am walking"); | |
} | |
} | |
class Bird : Animal | |
{ | |
public void fly() | |
{ | |
Console.WriteLine("i am flying"); | |
} | |
public void sing() | |
{ | |
Console.WriteLine("i am singing"); | |
} | |
} | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine("Hello World!"); | |
Bird bird = new Bird(); | |
bird.fly(); | |
bird.walk(); | |
bird.sing(); | |
} | |
} | |
} | |
namespace CodeChellange2 | |
{ | |
abstract class Book | |
{ | |
public String title; | |
public abstract void SetTitle(String theTitle); | |
public String getTitle() | |
{ | |
return title; | |
} | |
} | |
class Novel : Book | |
{ | |
public override void SetTitle(string theTitle) | |
{ | |
title = theTitle; | |
} | |
} | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Novel novel = new Novel(); | |
novel.SetTitle("Sikap Bodoh"); | |
Console.WriteLine("The title is "+novel.getTitle()); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment