We are writing a function that takes an object of type Any as a parameter and checks whether it is an integer. If the object is an integer, then the function returns the square of that number. If the object is not an integer, the function throws an exception and returns an error message. Which operator do you want to use?
Type cast and smart cast
Defining a variable type
Report a typo
Select one option from the list
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.