Import aliases
An alias is a way to introduce new names for types. If the type name is already used in the file, is inappropriate, or is too long, you can introduce a different name and use it instead of the original type name. An alias does not introduce a new type, and it is available only before compile time (when writing code). The compiler replaces a class alias with an actual class, so it does not exist at runtime.
Sometimes, we need to use a few classes with the same name in a single file. For example, the InterstitialAd type is defined both in the Facebook and Google advertising libraries. Let's suppose that we want to use them both in a single file. This situation is common in projects where we need to implement both ad providers ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access