Aprendiendo a modificar el tipo de variable en java ['ESP' ,'ENG']

in voilk •  6 months ago

    Hoy aprendí una nueva manera de cambiar el tipo del contenido de la variable, si por ejemplo uno posee un tipo de valor entero dentro de una variable, lo puede convertir a una cadena de texto o un doble. Esto lo aprendí con variables primitivas a las cuales se le puede sobrescribir el contenido y me dejo sorprendido el poder de Java.

    Today I learned a new way to change the type of the content of the variable, if for example one has an integer value type inside a variable, you can convert it to a text string or a double. I learned this with primitive variables whose content can be overwritten and I was surprised by the power of Java.
    Llevo unos años programando con JavaScript y hacerlo en este lenguaje de programación es fácil, porque otorga mucha libertad, pero en Java que es más estricto con su contenido todo cambia y si bien se puede recurrir a métodos con en JavaScript vale la pena aprender que existen otras maneras de manejar datos. Este tipo de conversión te permite alterar el tipo de dato de una manera un poco implícita en comparación con los métodos que transforman por ejemplo un entero a cadena de texto “toString()”.
    I have been programming with JavaScript for a few years and doing it in this programming language is easy, because it gives a lot of freedom, but in Java, which is more strict with its content, everything changes and although you can use methods in JavaScript, it is worth learning that they exist. other ways to handle data. This type of conversion allows you to alter the data type in a somewhat implicit way compared to the methods that transform, for example, an integer to a text string “toString()”.

      Authors get paid when people like you upvote their post.
      If you enjoyed what you read here, create your account today and start earning FREE VOILK!