{"id":512,"date":"2023-11-23T23:15:10","date_gmt":"2023-11-23T23:15:10","guid":{"rendered":"https:\/\/javigomez.org\/?p=512"},"modified":"2025-09-29T20:33:55","modified_gmt":"2025-09-29T20:33:55","slug":"u04-01-bucle-while-en-java","status":"publish","type":"post","link":"https:\/\/javigomez.org\/index.php\/2023\/11\/23\/u04-01-bucle-while-en-java\/","title":{"rendered":"U04-01-Bucle while en Java"},"content":{"rendered":"\n<p><br>En Java, un bucle <code>while<\/code> es una estructura de control de flujo que permite ejecutar un bloque de c\u00f3digo repetidamente mientras una condici\u00f3n especificada sea verdadera.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public class BucleWhileEjemplo {\n    public static void main(String&#91;] args) {\n        int contador = 0;\n\n        \/\/ Bucle while que se ejecuta mientras el contador sea menor que 5\n        while (contador &lt; 5) {\n            System.out.println(\"Contador: \" + contador);\n            contador++; \/\/ Incrementa el contador en cada iteraci\u00f3n\n        }\n\n        System.out.println(\"Bucle while terminado.\");\n    }\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 U04 01 while\" width=\"1200\" height=\"675\" src=\"https:\/\/www.youtube.com\/embed\/rizG6orxJT0?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 bucle while es una estructura de control de flujo que permite ejecutar un bloque de c\u00f3digo repetidamente mientras una condici\u00f3n especificada sea &hellip; <\/p>\n","protected":false},"author":1,"featured_media":513,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[59,350],"class_list":["post-512","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","tag-bucle","tag-while"],"_links":{"self":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/512","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=512"}],"version-history":[{"count":1,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/512\/revisions"}],"predecessor-version":[{"id":921,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/512\/revisions\/921"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/media\/513"}],"wp:attachment":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/media?parent=512"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/categories?post=512"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/tags?post=512"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}