Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

194
Vistas
Using of Keywords as variable names

Why does the first line compile and the second not?

string var = "123";

var string = "123";

I mean string and var should be both keywords..

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

var is a contextual keyword, whereas string is not.

Contextual keywords are

used to provide a specific meaning in the code, but it is not a reserved word in C#.

This is why you can use var as a variable name.

Presumably, this is for backwards compatibility. If var were introduced as a proper keyword, old code that uses var as a variable name would break.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda