Coercion operator
The coercion operator (as) is a variant of casting. Coercion converts object from one type to another without them being compatible for assignment. Let’s take an example:
Integer x = 123
String s = (String) x
Integer is not assignable to a String, so it will produce a ClassCastException at runtime
This can be fixed by using coercion instead:
Integer x = 123
String s = x as String
Integer is not assignable to a String, but use of as will coerce it to a String