{"id":571,"date":"2023-12-09T12:56:46","date_gmt":"2023-12-09T12:56:46","guid":{"rendered":"https:\/\/javigomez.org\/?p=571"},"modified":"2025-09-29T20:33:44","modified_gmt":"2025-09-29T20:33:44","slug":"u06-01-arrays","status":"publish","type":"post","link":"https:\/\/javigomez.org\/index.php\/2023\/12\/09\/u06-01-arrays\/","title":{"rendered":"U06-01-Arrays"},"content":{"rendered":"\n<p>En Java, un array es una estructura de datos que permite almacenar un conjunto de elementos del mismo tipo bajo un solo nombre. Los elementos en un array est\u00e1n indexados, es decir, cada elemento tiene un n\u00famero asociado que indica su posici\u00f3n en el array. El \u00edndice del primer elemento generalmente comienza en 0.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package U6;\n\nimport java.util.Arrays;\n\npublic class A000 {\n\n\tpublic static void main(String&#91;] args) {\n\t\t\n\t\tint edades&#91;] = new int&#91;5];\n\t\t\n\t\tedades&#91;0]=12;\n\t\tedades&#91;1]=23;\n\t\tedades&#91;2]=2;\n\t\t\n\t\tSystem.out.println(edades&#91;1]);\n\t\t\n\t\t\n\t\tint ele&#91;]= {2,5,6,2};\n\t\t\n\t\tSystem.out.println(ele&#91;1]);\n\t\t\n\t\tSystem.out.println(edades);\n\t\t\n\t\tint edades2&#91;];\n\t\t\n\t\tedades2=edades;\n\t\t\n\t\tedades2&#91;1]=99;\n\t\t\n\t\tSystem.out.println(edades&#91;1]);\n\t\t\n\t\t\n\t\tSystem.out.println(ele&#91;4]);\/\/DA ERROR\n\n\t}\n}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Java U6 01 Arrays\" width=\"1200\" height=\"675\" src=\"https:\/\/www.youtube.com\/embed\/M4yWXziSbyo?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>En Java, un array es una estructura de datos que permite almacenar un conjunto de elementos del mismo tipo bajo un solo nombre. Los elementos &hellip; <\/p>\n","protected":false},"author":1,"featured_media":572,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[43,45,194,203],"class_list":["post-571","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","tag-arrays","tag-arreglos","tag-indice","tag-java"],"_links":{"self":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/571","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/comments?post=571"}],"version-history":[{"count":1,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/571\/revisions"}],"predecessor-version":[{"id":909,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/571\/revisions\/909"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/media\/572"}],"wp:attachment":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/media?parent=571"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/categories?post=571"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/tags?post=571"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}