반응형
[C#] IDisposable (Dispose), 종료자(Finalizer)
C#2023. 10. 10. 09:00[C#] IDisposable (Dispose), 종료자(Finalizer)

IDisposable 인터페이스 https://learn.microsoft.com/ko-kr/dotnet/api/system.idisposable?view=net-7.0 IDisposable 인터페이스 (System) 관리되지 않은 리소스 해제를 위한 메커니즘을 제공합니다. learn.microsoft.com namespace System { public interface IDisposable { void Dispose(); } } - C#의 using문은 IDisposable을 구현하는 개체에 대해 Dispose 메서드를 try/finally 블록을 이용해서 호출하는 코드를 단축 표기 // 컴파일러는 이 코드를 using (FileStream fs = new FileStream("myfile.txt",..

[C#] IStructuralEquatable, IStructuralComparable
C#2023. 10. 8. 09:00[C#] IStructuralEquatable, IStructuralComparable

IStructuralEquatable 인터페이스 IStructuralEquatable 인터페이스 (System.Collections) 개체의 구조가 같은지 비교할 수 있는 메서드를 정의합니다. learn.microsoft.com namespace System.Collections { public interface IStructuralEquatable { bool Equals(object other, IEqualityComparer comparer); int GetHashCode(IEqualityComparer comparer); } } IStructuralComparable 인터페이스 IStructuralComparable 인터페이스 (System.Collections) 컬렉션 개체의 구조 비교를 지원합..

[C#] StringComparer
C#2023. 10. 6. 09:00[C#] StringComparer

StringComparer 클래스 StringComparer 클래스 (System) 특정 대/소문자 및 문화권 기반 또는 서수 비교 규칙을 사용하는 문자열 비교 연산을 나타냅니다. learn.microsoft.com namespace System { public abstract class StringComparer : IComparer, IEqualityComparer, IComparer, IEqualityComparer { protected StringComparer(); public static StringComparer InvariantCulture { get; } public static StringComparer InvariantCultureIgnoreCase { get; } public sta..

[C#] IComparer<T>, IComparer, Comparer<T>
C#2023. 10. 4. 09:00[C#] IComparer<T>, IComparer, Comparer<T>

IComparer 인터페이스 IComparer 인터페이스 (System.Collections.Generic) 형식에서 두 개체를 비교하기 위해 구현하는 메서드를 정의합니다. learn.microsoft.com namespace System.Collections.Generic { public interface IComparer { int Compare(T x, T y); } } IComparer 인터페이스 IComparer 인터페이스 (System.Collections) 두 개체를 비교하는 메서드를 노출합니다. learn.microsoft.com namespace System.Collections { public interface IComparer { int Compare(object x, object y..

반응형
image