Pocket Kotlin-C# Dictionary. A
Tags: kotlin, csharp
Published: 2023-09-22 13:07:57

## A

| Kotlin | C# |
| --- | --- |
| **abstract**<br> Modifier for classes, properties and functions [Learn more](https://kotlinlang.org/docs/classes.html#class-members) | **abstract**<br> Modifier for classes, methods, properties, indexers, and events [Learn more](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/abstract) |
| **actual**<br> Platform-specific modules feature. Functions, classes, interfaces, enumerations, properties, and annotations can be declared as **expect** in common module, and **actual** in platform-specific implementations. As of 2023 expect/ actual feature is in Beta [Learn more](https://kotlinlang.org/docs/multiplatform-connect-to-apis.html) | Kotlin **expect** is like an interface, it cannot have an implementation, and **actual** is like an implementation of interface feature (but it can be an interface itself).<br> _Update._ See @teneko 's comments below to see how to get the same behavior using **partial** methods and conditional preprocessor directives.
| **also()**<br> Scope function. Used to avoid _if (x == null)_ construction at any price [Learn more](https://kotlinlang.org/docs/scope-functions.html#function-selection) | No short equivalent.<br> Can be defined as extention function that takes lambda and returns the object it extends |
| **Anko**<br>Kotlin library for Android, deprecated as of 2023 [Learn more](https://stackoverflow.com/questions/68268194/what-do-i-use-now-that-anko-is-deprecated)<br> _(etymology: ANdroid + KOtlin)_ | **Xamarin.Forms**<br> Xamarin is cross-platform, while Anko is not [Learn more](https://dotnet.microsoft.com/en-us/apps/xamarin/xamarin-forms)|
| **annotation**<br> Annotation class defines custom formats for storing metadata [Learn more] (https://kotlinlang.org/docs/annotations.html) | **System.Attribute** interface<br> Class that implements System.Attribute interface defines custom attributes, i.e. formats for storing metadata [Learn more](https://learn.microsoft.com/en-us/dotnet/csharp/advanced-topics/reflection-and-attributes/creating-custom-attributes) |
| **Any**<br> Root of type hierarchy [Learn more](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/) | **object**<br> Root of type hierarchy [Learn more](https://learn.microsoft.com/en-us/dotnet/api/system.object?view=net-7.0) |
| **apply()**<br> Scope function. Used to avoid _if (x == null)_ construction at any price [Learn more](https://kotlinlang.org/docs/scope-functions.html#function-selection) | No short equivalent.<br> Can be defined as extention function that takes lambda and returns the object it extends |
| **as**<br> Unsafe cast operator, throws an exception when fails [Learn more](https://kotlinlang.org/docs/typecasts.html#unsafe-cast-operator) | **(T)x** type cast<br> Throws an exception when fails [Learn  more](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/type-testing-and-cast#cast-expression) |
| **as?**<br> Safe cast operator, returns null if fails to cast [Learn more](https://kotlinlang.org/docs/typecasts.html#safe-nullable-cast-operator) | **as**<br>Returns null if fails to cast [Learn more](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/type-testing-and-cast#as-operator) |