as keyword in c# | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

as keyword in c#

What converting a data type and casting a data type is the same 🤔 Needs your precious notes in this 🙂

1st Jul 2022, 5:58 AM
Sufian Ahmad
Sufian Ahmad - avatar
1 Respuesta
0
I found with a little research that Casting is a way of telling the compiler "Object X is Type Y", go ahead and treat it as such.. The conversation is saying that I know Object X isn't Type Y, but there exists a way of creating a new object from X of type Y, go ahead and do it.
1st Jul 2022, 6:03 AM
Sufian Ahmad
Sufian Ahmad - avatar