All pastes #919071 Raw Edit

Rickywh

public text v1 · immutable
#919071 ·published 2008-02-26 15:58 UTC
rendered paste body
using System;
using System.Collections;

namespace RickyTest
{
	public class Cat : Animals
	{
		public string name;
		public int age;
		
		public Cat(string name, int age)
		{
			this.name = name;
			this.age = age;
			
			Console.WriteLine("A new cat was just created named {0} and is {1} years old", this.name, this.age);
		}
		
		public override void Info()
		{
			string info = "This is the new overridden info, omg!";
			
				Console.WriteLine(info);
		}
		public void Info(int number)
		{
			string info = "This is the alternate overloaded info, omg omg";
			int testNumber = 5 + number;
			
			Console.WriteLine("testing testing {0} and {1}", info, testNumber);
		}
	}
	
	public class Animals
	{
		public string info = "All Animals can talk and they like to say 'Hi'";
		public Animals()
		{
			Console.WriteLine("{0}", this.info);
		}
		public virtual void Info()
		{
			Console.WriteLine("{0}", this.info);
		}
	}
	
	public class TestApplication
	{
		static void Main()
		{
			Cat ricky = new Cat("RickyWh", 26);
			ricky.Info(5);
		}
	}
}