52.30K
Category: programmingprogramming

Классы C#

1.

Классы c#

2.

Смысл?

3.

using System;
class HelloWorld {
static void Main() {
Console.WriteLine("Hello World");
}
}

4.

public
private
static

5.

using System;
public class NotConsole
class HelloWorld
{
{
public static void WriteLine(string message)
static void Main()
{
{
Console.WriteLine(message);
string stroka =
NotConsole.ReadLine();
}
NotConsole.WriteLine(stroka);
}
public static string ReadLine()
}
{
return Console.ReadLine();
}
}

6.

using System;
public class NotConsole
class HelloWorld
{
{
public static void WriteLine(string message)
static void Main()
{
{
Console.WriteLine(message);
NotConsole notConsole = new
NotConsole();
}
string stroka =
notConsole.ReadLine();
public static string ReadLine()
notConsole.WriteLine(stroka);
{
}
return Console.ReadLine();
}
}
}

7.

Поля и свойства, методы
public class NotConsole {
public int Paranetr1 { get; set; }
public int Paranetr2;
public int GoodMetod()
{
retent 1;
}
}

8.

Задания
1) Скачать и открыть Leson
2) Решить проблемы ErrorMetod()
3) Вывести в консоль факториал числа используя Leson.Factorial(N)
4) Объявить переменную класса Leson
5) Вывести в консоль все переменные “ParanetrN” класса Leson
6) Вывести в консоль оценку определенную классом Leson
7) Устроить взлом(После проверки остальных заданий)
English     Русский Rules