cSharp learning course

using System;

public class Program

{

public static void Main()

{

Cat a = new Cat();

Cat b = new Cat();

Console.WriteLine(Cat.eCount);

Dog.Bark();

Console.WriteLine(MyMath.myPi);

Console.WriteLine(MyClass.a);

Console.WriteLine(MyClass.b);

}

class Cat

{

public static int eCount = 0;

public Cat()

{

eCount++;

}

~Cat()

{

}

}

class Dog

{

public static void Bark()

{

Console.WriteLine("Woof");

}

}

class MyMath

{

public const double myPi = 3.14;

}

class MyClass

{

public static int a {get; set;}

public static int b {get; set;}

static MyClass()

{

a = 5;

b = 20;

}

}

}



Dodaj komentarz






Dodaj

© 2013-2024 PRV.pl
Strona została stworzona kreatorem stron w serwisie PRV.pl