KO CSharp Keyword out - LIHACHTETAN/ClassicUO-Bad-Newbie-CSharp-Scripts-IDE GitHub Wiki
ะฃะบัะฐัะฝััะบะฐ ยท ะ ัััะบะธะน ยท English ยท Deutsch ยท Franรงais ยท Italiano ยท Espaรฑol ยท ็น้ซไธญๆ ยท ๆฅๆฌ่ช ยท ํ๊ตญ์ด
ํธ๋๋ถ C# ยท ์ค์ฉ ๊ฐ์ด๋
๋ฉ์๋๊ฐ ๊ฒฐ๊ณผ๋ฅผ ๋งค๊ฐ๋ณ์์ ์ธ ์ ์๋๋ก ํฉ๋๋ค. ๋ฉ์๋๋ ์ ์์ ์ผ๋ก ๋ฐํ๋๊ธฐ ์ ์ ์ด๋ฅผ ํ ๋นํด์ผ ํฉ๋๋ค. ์ ๋ค๋ฆญ ์ ํ์์๋ ๊ณต๋ถ์ฐ์ ์ค์ ํฉ๋๋ค.
์ด ์์ ๋ฅผ Example.cs๋ก ๋ฐ๋ก ์ ์ฅํ๊ณ ์ด ํ์ด์ง์ ๋ค๋ฅธ ์์ ์ ๋
๋ฆฝ์ ์ผ๋ก ์คํํ์ธ์.
Example.cs:
// PROJECT-EXAMPLE
if (int.TryParse("12", out int number))
System.Console.WriteLine(number);๊ฒฐ๊ณผ:
12
Method(out value) / interface IProducer<out T>using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.IO;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
public static class Program
{
public static async Task Main(string[] args)
{
if (int.TryParse("42", out int number)) Console.WriteLine(number);
}
}using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.IO;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
public static class Program
{
public static async Task Main(string[] args)
{
IProducer<string> text = new TextProducer();
IProducer<object> value = text;
Console.WriteLine(value.Create());
}
}
public interface IProducer<out T> { T Create(); }
public class TextProducer : IProducer<string> { public string Create() => "ore"; }๊ณต์ ์ถ์ฒ: Microsoft ํ์ต.