Skip to content

Instantly share code, notes, and snippets.

@omayib
Created June 28, 2021 01:32
Show Gist options
  • Save omayib/c9b85e5d875e85f7561e869ec543a4ea to your computer and use it in GitHub Desktop.
Save omayib/c9b85e5d875e85f7561e869ec543a4ea to your computer and use it in GitHub Desktop.
a code jam
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