学的东西不解释啊。有的不会。。。我也问问别人吧。
哎第一天上课,昨天的的课所以没听。因为没来。今天学起来很惆怅啊。住
了一个多月院。。。花了三万块钱还有。。我的暑假。。。在省二院见到好
多糖尿病的人。发现自己还算好的呵呵。不过耽误学校一些事情也算解决了
。哎现在我很穷了呵呵。还是把今天学的东西记到博客上吧。以后也许会看
看呢。
namespace InterfaceDemo
{
class Program
{
static void Main(string[] args)
{
int[] pins=new int[4]{4,8,5,9};
int[] copy = new int[pins.Length];
pins.CopyTo(copy, 0);
foreach (int i in copy)
{
Console.WriteLine(i);
}
pins[0] = 99999;
foreach (int i in copy)
{
Console.WriteLine(i);
}
Console.WriteLine
("")
;
// int[] ailas = pins;
// for (int i = 0; i < pins.Length; i++)
// {
// ailas[i] = pins[i];
// }
// foreach (int i in ailas)
// {
// Console.WriteLine(i);
// }
// pins[3] = 10000;
// foreach (int i in ailas)
// {
// Console.WriteLine(i);
// }
// int[] arry = new int[10];
// int number=0;
// for (int i = 0; i < arry.Length; i++)
// {
// number = number + 10;
// arry[i] = number;
// }
// foreach (int i in arry)
// {
// Console.WriteLine(i);
// }
// Horse horse = new Horse("斑马维尼");
//Console.WriteLine( horse.getName());
// horse.ChrewGrass();
// Sheep sheep = new Sheep("绵羊妮妮");
// Console.WriteLine(sheep.getName());
// sheep.ChrewGrass();
// Cow cow = new Cow("小牛麦克");
// Console.WriteLine(cow.getName());
// cow.ChrewGrass();
// BanBa banMa = new BanBa("littleBM");
//banMa.Trot();
// IJourney journeyHorse = horse;
// int legs= journeyHorse.NumberOfLegs();
// Console.WriteLine(legs);
// ILandBound landHorse = horse;
//legs=landHorse.NumberOfLegs();
//Console.WriteLine(legs);
//ILandBound landbound = horse;
//Console.WriteLine( landbound.NumberOfLegs());
//这里可以把接口看成广义上的父类,以上这例子就是父类
引用子类对象
Console.ReadKey();
}
}
}
class Mammal
{
private string name;
public string getName()
{
return name;
}
public Mammal(string initialName)
{
name = initialName;
}
public void Breath()
{
Console.WriteLine(name+"这个哺乳动物正在呼吸");
}
public void SunkleYoung()
{
Console.WriteLine(name+"这个哺乳动物正在哺乳");
}
}
没什么改动。因为我怕该错了。呵呵以后要是自己看到要记得努力哦。
加油!