{"id":625,"date":"2024-01-18T15:25:23","date_gmt":"2024-01-18T15:25:23","guid":{"rendered":"https:\/\/javigomez.org\/?p=625"},"modified":"2025-09-29T20:33:34","modified_gmt":"2025-09-29T20:33:34","slug":"u06-14-arraylist-iv","status":"publish","type":"post","link":"https:\/\/javigomez.org\/index.php\/2024\/01\/18\/u06-14-arraylist-iv\/","title":{"rendered":"U06-14-ArrayList IV"},"content":{"rendered":"\n<p>Solicitar nombres hasta escribir \u201cSalir\u201d. A continuaci\u00f3n, mostrar los nombres sin que haya ninguno repetido.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package U6;\n\nimport java.util.ArrayList;\nimport java.util.Scanner;\n\npublic class A000 {\n\n\tpublic static void main(String&#91;] args) {\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\tArrayList&lt;String> datos = new ArrayList&lt;>();\n\t\tString a=\"\";\n\t\tdo {\n\t\t\tSystem.out.println(\"Introducir nombre\");\n\t\t\ta=sc.next();\n\t\t\tif (!a.equals(\"Salir\"))\n\t\t\t\tif (!datos.contains(a))\n\t\t\t\t\tdatos.add(a);\n\t\t}while (!a.equals(\"Salir\"));\n\t\t\n\t\tSystem.out.println(datos);\n\t\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 14 ArrayList IV\" width=\"1200\" height=\"675\" src=\"https:\/\/www.youtube.com\/embed\/lkwDGmGfMJU?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>Solicitar nombres hasta escribir \u201cSalir\u201d. A continuaci\u00f3n, mostrar los nombres sin que haya ninguno repetido.<\/p>\n","protected":false},"author":1,"featured_media":618,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[42,93,135,203],"class_list":["post-625","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","tag-arraylist","tag-contains","tag-equals","tag-java"],"_links":{"self":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/625","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=625"}],"version-history":[{"count":1,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/625\/revisions"}],"predecessor-version":[{"id":895,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/625\/revisions\/895"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/media\/618"}],"wp:attachment":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/media?parent=625"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/categories?post=625"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/tags?post=625"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}