Aprendiendo a crear Arrays en Java [ESP-ENG]

avatar

Aún sigo aprendiendo como autodidacta programación orientada a objetos en Java, un lenguaje bastante útil y con una sintaxis mucho más estricta a lo que estoy acostumbrado.
Si bien crear un array no varía mucho de un lenguaje a otro, la adición del tipo de dato que acepta dentro si es algo nuevo para mí, java me obliga a ser especifico con muchas cosas, pero aun asi me gusta.

I'm still learning object-oriented programming in Java as a self-taught person, a very useful language with a much stricter syntax than what I'm used to. Although creating an array does not vary much from one language to another, the addition of the type of data it accepts inside is something new for me, Java forces me to be specific with many things, but I still like it.

arrs.jpg
Para este caso utilizare el método constructor de Java que también se puede utilizar en otros lenguajes conocido como “new”, la razón es simple; otorga todos los métodos que acepta un arregla para trabajar con su contenido, aunque por el momento es solo de muestra.
Para especificar la cantidad de datos que aceptara se lo agrego dentro de corchetes con un número que está guardado dentro de una variable.
Si deseara ver alguno en específico tendría que estar colocando el índice manualmente, pero con un ciclo “for” puedo mostrar todos más rápido ya que el arreglo es bastante pequeño.

For this case I will use the Java constructor method that can also be used in other languages ​​known as “new”, the reason is simple; It provides all the methods that an array accepts to work with its content, although at the moment it is only a sample. To specify the amount of data it will accept, I add it inside square brackets with a number that is stored inside a variable. If I wanted to see a specific one I would have to manually set the index, but with a “for” loop I can show them all faster since the array is quite small.


0
0
0.000
1 comments
avatar

Thanks for your contribution to the STEMsocial community. Feel free to join us on discord to get to know the rest of us!

Please consider delegating to the @stemsocial account (85% of the curation rewards are returned).

You may also include @stemsocial as a beneficiary of the rewards of this post to get a stronger support. 
 

0
0
0.000