Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
School/C# - Beginner (Denis)/Lesson 23/lesson_23.cs
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
138 lines (127 sloc)
2.34 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace HelloApp | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
} | |
} | |
} | |
namespace HelloApp | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Account account = new Account(4); | |
} | |
} | |
class Account | |
{ | |
public int Id { get; private set; } // номер счета | |
public Account(int _id) | |
{ | |
Id = _id; | |
} | |
} | |
} | |
using System; | |
namespace HelloApp | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine("hello"); | |
} | |
} | |
} | |
static void Main(string[] args) | |
{ | |
System.Console.WriteLine("hello"); | |
} | |
using HelloApp.AccountSpace; | |
namespace HelloApp | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Account account = new Account(4); | |
} | |
} | |
namespace AccountSpace | |
{ | |
class Account | |
{ | |
public int Id { get; private set; } | |
public Account(int _id) | |
{ | |
Id = _id; | |
} | |
} | |
} | |
} | |
using printer = System.Console; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
printer.WriteLine("Hello from C#"); | |
printer.Read(); | |
} | |
} | |
using Person = HelloApp.User; | |
using Printer = System.Console; | |
namespace HelloApp | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Person person = new Person(); | |
person.name = "Tom"; | |
Printer.WriteLine(person.name); | |
Printer.Read(); | |
} | |
} | |
class User | |
{ | |
public string name; | |
} | |
} | |
using static System.Console; | |
namespace HelloApp | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
WriteLine("Hello from C# 8.0"); | |
Read(); | |
} | |
} | |
} | |
using static System.Console; | |
using static System.Math; | |
using static HelloApp.Geometry; | |
namespace HelloApp | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
double radius = 50; | |
double result = GetArea(radius); //Geometry.GetArea | |
WriteLine(result); //Console.WriteLine | |
Read(); // Console.Read | |
} | |
} | |
class Geometry | |
{ | |
public static double GetArea(double radius) | |
{ | |
return PI * radius * radius; // Math.PI | |
} | |
} | |
} |