Computer scienceProgramming languagesKotlinObject-oriented programmingObject-oriented programming usage

Packages and imports

Same class, two names

Report a typo

You want to use StringBuilder class, but due to readability issues, you want to be able to define your variables with two different names: e.g., StringBuilder and KotlinStringBuilder.

Please write the necessary code snippet to resolve this situation with importing.

fun main(args: Array<String>) {
    val sb = StringBuilder()
    val sb2 = KotlinStringBuilder()
}
Enter a short text
___

Create a free account to access the full topic