.


:




:

































 

 

 

 


-

10

,

:

, Visual Studio.Net.

. , , . , , . , , , , , , . , , . . - . , . , .

. . , , , . - , , .

, , :

class [_]: [__]

{

//

}

 

. , :

class Animal

{

public string Name { get; set; }

}

class Dog: Animal

{

public void Guard()

{

//

}

}

class Cat: Animal

{

public void CatchMouse()

{

//

}

}

class Program

{

static void Main(string[] args)

{

Dog dog1 = new Dog();

dog1.Name = ""; //

Cat cat1 = new Cat();

cat1.Name = ""; //

dog1.Guard(); //

cat1.CatchMouse(); //

}

}

 

-

- , , . , , ( ), .

, , .

, . base. - :

[__-] ([]): base ([])

{

//

}

 

.

. . , , . , . , , , , :

class Animal

{

public string Name { get; set; }

public Animal(string name)

{

Name = name;

}

}

class Parrot: Animal

{

public double BeakLength { get; set; } //

public Parrot(string name, double beak): base(name)

{

BeakLength = beak;

}

}

class Dog: Animal

{

public Dog(string name): base (name)

{

//

}

}

class Program

{

static void Main(string[] args)

{

Parrot parrot1 = new Parrot("", 4.2);

Dog dog1 = new Dog("");

}

 



<== | ==>
Les sites à succès du tourisme en France |
:


: 2017-02-11; !; : 646 |


:

:

- , - .
==> ...

1493 - | 1412 -


© 2015-2024 lektsii.org - -

: 0.009 .