as keyword in c# | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
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 Resposta
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