This is called Casting. The value returned by the Dequeue
method is cast to a String
type.
Essentially this operation forces the value to take the type of String
so that you can assign it to a variable which is also of type String
. You should note however that casting from one type to another may not always succeed.
For example, this will give you a compile-time error:
int a = (int)"123";