<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3949108534218115935</id><updated>2026-01-28T03:27:09.089-05:00</updated><category term="java"/><category term="algorithm"/><category term="download"/><category term="eclipse"/><category term="netbeans"/><category term="archivos"/><category term="cmd"/><category term="compiling"/><category term="criptografia"/><category term="crypto"/><category term="ficheros"/><category term="files"/><category term="ubuntu"/><category term="windows"/><category term="DES"/><category term="Vigenere"/><category term="class"/><category term="combinaciones"/><category term="constructor"/><category term="destructor"/><category term="escuchadores"/><category term="eventos"/><category term="executing"/><category term="generator"/><category term="icedtea"/><category term="jar"/><category term="javac"/><category term="jdk"/><category term="jre"/><category term="jvm"/><category term="lector de consola"/><category term="linux"/><category term="listener"/><category term="oracle"/><category term="programación"/><category term="shell"/><category term="swing"/><category term="temp.mf"/><category term="terminal"/><title type='text'>Programacion II</title><subtitle type='html'>Programación en Java, utilizando los paradigmas de orientado a objetos y así también la forma estructurada utilizando el IDE Netbeans 8.2, Conceptos Básicos de la Programación y Herramientas Útiles para la misma en Descarga Gratis!!. Enlaces a Paginas de Interés con temas de Informática, Hacking, Infosec, Curiosidades, Software Libre, Sistemas Operativos GNU/Linux (Ubuntu) y por último enlaces a los sitios de la Comunidad de Software Libre y Seguridad Informática - Hackem (Quito-Ecuador)</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gl-epn-programacion-ii.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>38</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3949108534218115935.post-3677824722397900489</id><published>2013-05-03T23:48:00.000-05:00</published><updated>2013-09-05T00:18:22.196-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="algorithm"/><category scheme="http://www.blogger.com/atom/ns#" term="combinaciones"/><category scheme="http://www.blogger.com/atom/ns#" term="download"/><category scheme="http://www.blogger.com/atom/ns#" term="ficheros"/><category scheme="http://www.blogger.com/atom/ns#" term="files"/><category scheme="http://www.blogger.com/atom/ns#" term="generator"/><category scheme="http://www.blogger.com/atom/ns#" term="lector de consola"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><title type='text'>Generador de Combinaciones de n, r en Consola en Java</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: white; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6; font-family: &#39;Trebuchet MS&#39;, Verdana, Arial, sans-serif; font-size: large; font-weight: bold; line-height: 16px; margin: 0px; padding: 0px;&quot;&gt;Generador de Combinaciones de n, r en Java&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEis274sipX1w48YeamyVvkeivNg8D3BljUecKytNEtsVYreSmW0Gsj7IoQFAvEsbJmHN7IqdzU0k-epWFepZCcnRrYlnuFCZi22yOGMp2nIilflVmBCIeYSHoh-_lu1Lp3v4Yu9e6Oibp8/s1600/cryptex-logo.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEis274sipX1w48YeamyVvkeivNg8D3BljUecKytNEtsVYreSmW0Gsj7IoQFAvEsbJmHN7IqdzU0k-epWFepZCcnRrYlnuFCZi22yOGMp2nIilflVmBCIeYSHoh-_lu1Lp3v4Yu9e6Oibp8/s1600/cryptex-logo.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Gracias a la pregunta de una amiga sobre Matemáticas Discretas, en esta ocasión quiero compartir un poco acerca de la combinatoria enumerativa, la cual estudia los métodos para contar (enumerar) las distintas configuraciones de los elementos de un conjunto que cumpla con ciertos criterios especificados.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Esta fue una de las primeras áreas de la combinatoria en ser desarrollada, y como otras áreas más recientes se estudian sólo en cursos especializados, es común que se haga referencia a esta subárea cuando se menciona combinatoria en entornos educativos.&lt;/div&gt;
&lt;div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Un ejemplo citado de Wikipedia para facilitar la comprensión de este artículo es el siguiente:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Considérese el conjunto S = {A, E, I, O, U}. Podemos imaginar que estos elementos corresponden a tarjetas dentro de un sombrero.&lt;/div&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;Un primer problema podría consistir en hallar el número de formas diferentes en que podemos sacar las tarjetas una después de otra (es decir, el número de permutaciones del conjunto). Por ejemplo, dos formas distintas podrían ser: EIAOU o OUAIE.&lt;/li&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;Después, se puede preguntar por el número de formas en que se puede sacar sólo 3 tarjetas del sombrero (es decir, el número de 3-permutaciones del conjunto). En este caso, ejemplos pueden ser IOU, AEI o EAI.&lt;/li&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;También se puede preguntar sobre cuáles son los posibles grupos de 3 tarjetas que se pueden extraer, sin dar consideración al orden en que salen (en otras palabras, el valor de un coeficiente binomial). Aquí, consideraríamos AOU y UAO como un mismo resultado.&lt;/li&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;Otro problema consiste en hallar el número de formas en que pueden salir 5 tarjetas, una tras otra, pero en cada momento se regresa la tarjeta escogida al sombrero. En este problema los resultados posibles podrían ser EIOUO, IAOEU o IEAEE.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Luego de esta explicación teórica procedamos a trabajar con el código, la siguiente función genera las combinaciones utilizando un algoritmo de Kenneth H. Rosen.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
//La función recibe los valores de n y r como argumentos&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
public static void combinaciones(int n, int r)&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
{&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int i = 0, j = 0, ci = 0;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int v[] = new int[n];&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for(i = 0; i &amp;lt; n; i++)&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; { v[i]=i; }&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; escribe(v, r);&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ci++;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while(ci &amp;lt; p1)&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; i = r - 1;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while (v[i] == n - r + i) { i--; }&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; v[i] = v[i] + 1;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (j = i + 1; j &amp;lt; r; j++) { v[j] = v[i] + j - i; }&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; escribe(v,r);&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ci++;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
}&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
La función de nombre &quot;escribe&quot; que es llamada en el código anterior nos sirve para imprimir los resultados en la consola del IDE, para descargar una copia completa del Programa funcionando procede a la JavaBox al final del Blog.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gl-epn-programacion-ii.blogspot.com/feeds/3677824722397900489/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2013/05/generador-de-combinaciones-de-n-r-en.html#comment-form' title='22 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/3677824722397900489'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/3677824722397900489'/><link rel='alternate' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2013/05/generador-de-combinaciones-de-n-r-en.html' title='Generador de Combinaciones de n, r en Consola en Java'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEis274sipX1w48YeamyVvkeivNg8D3BljUecKytNEtsVYreSmW0Gsj7IoQFAvEsbJmHN7IqdzU0k-epWFepZCcnRrYlnuFCZi22yOGMp2nIilflVmBCIeYSHoh-_lu1Lp3v4Yu9e6Oibp8/s72-c/cryptex-logo.jpg" height="72" width="72"/><thr:total>22</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3949108534218115935.post-5433926101646882090</id><published>2013-04-03T00:16:00.000-05:00</published><updated>2014-03-05T05:31:04.884-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="escuchadores"/><category scheme="http://www.blogger.com/atom/ns#" term="eventos"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="listener"/><category scheme="http://www.blogger.com/atom/ns#" term="swing"/><title type='text'>Eventos en Swing</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;Eventos en Java Swing&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjj9miCCaOOZRedELh517PtXcMzqyBRBNSQvaCVA1WX0r4S3UlVn1EGo5TZIGFFFLOUJ-UePxOiufFKYw85hDHW8oxFRv1YZWIHTQVK6WvvHejcsV8SXNXvkCVMPaGOgm5FtXhO407DjUY/s1600/Java_Swing_GL.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjj9miCCaOOZRedELh517PtXcMzqyBRBNSQvaCVA1WX0r4S3UlVn1EGo5TZIGFFFLOUJ-UePxOiufFKYw85hDHW8oxFRv1YZWIHTQVK6WvvHejcsV8SXNXvkCVMPaGOgm5FtXhO407DjUY/s1600/Java_Swing_GL.gif&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
En Java Swing, cada vez que el usuario interactúa con la aplicación se gatilla un evento, para que una componente determinada reaccione frente a un evento, debe poseer un&amp;nbsp;&lt;i&gt;&quot;escuchador&quot;&lt;/i&gt;&amp;nbsp;(Listener) con, al menos, un método determinado que se ejecutará al escuchar un evento en particular, por ejemplo, en el siguiente código se crea un botón que al ser presionado imprime en la salida estándar un mensaje.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;
&lt;pre&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;
JButton boton=new JButton(&quot;Un botón&quot;);&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
boton.addActionListener(new ActionListener()
{&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
public void actionPerformed(ActionEvent e)
    {&lt;/div&gt;
System.out.println(&quot;Apretó el Botón&quot;);
    }
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
}

&lt;/pre&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Swing puede utilizar una variedad set de eventos, en la siguiente tabla se resumen los más comunes con sus respectivos&amp;nbsp;&lt;i&gt;&quot;escuchadores&quot;&lt;/i&gt;.&lt;/div&gt;
&lt;blockquote&gt;
&lt;table border=&quot;1&quot; style=&quot;text-align: justify;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;br /&gt;
&lt;center&gt;
&lt;b&gt;Ejemplos de eventos y sus escuchadores&lt;/b&gt;&lt;/center&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;b&gt;Acción que activa un evento&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Tipo de escuchador&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;El usario hace un click, presiona Return&lt;br /&gt;
en un área de texto o selecciona un menú&lt;/td&gt;&lt;td&gt;&lt;code&gt;ActionListener(Acciones Sobre Componentes)&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;El usuario escoje un frame (ventana principal)&lt;/td&gt;&lt;td&gt;&lt;code&gt;WindowListener&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;El usuario hace un click sobre una componente&lt;/td&gt;&lt;td&gt;&lt;code&gt;MouseListener&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;El usuario pasa el mouse sobre una componente&lt;/td&gt;&lt;td&gt;&lt;code&gt;MouseMotionListener&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Una componente se hace visible&lt;/td&gt;&lt;td&gt;&lt;code&gt;ComponentListener&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Una componente adquiere el foco del teclado&lt;/td&gt;&lt;td&gt;&lt;code&gt;FocusListener&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Cambia la selección en una lista o tabla&lt;/td&gt;&lt;td&gt;&lt;code&gt;ListSelectionListener&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/blockquote&gt;
Si tienen cualquier duda, pueden comunicarse a través de los comentarios. =)</content><link rel='replies' type='application/atom+xml' href='http://gl-epn-programacion-ii.blogspot.com/feeds/5433926101646882090/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2013/04/eventos-en-swing.html#comment-form' title='2 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/5433926101646882090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/5433926101646882090'/><link rel='alternate' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2013/04/eventos-en-swing.html' title='Eventos en Swing'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjj9miCCaOOZRedELh517PtXcMzqyBRBNSQvaCVA1WX0r4S3UlVn1EGo5TZIGFFFLOUJ-UePxOiufFKYw85hDHW8oxFRv1YZWIHTQVK6WvvHejcsV8SXNXvkCVMPaGOgm5FtXhO407DjUY/s72-c/Java_Swing_GL.gif" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3949108534218115935.post-3448348932565113927</id><published>2013-03-03T22:00:00.000-05:00</published><updated>2013-03-31T23:02:10.674-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="icedtea"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="jdk"/><category scheme="http://www.blogger.com/atom/ns#" term="jre"/><category scheme="http://www.blogger.com/atom/ns#" term="jvm"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>Instalar Oracle Java 7 en Ubuntu 12.04</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;b style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, Verdana, Arial, sans-serif; font-size: large; line-height: 18.90625px;&quot;&gt;Instalar Oracle Java 7 en Ubuntu 12.04&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiv4_RgsJos3pUN4ZvQbL1dm-7nqdFXRSiK_e8mt8WJd1WtCOG_J6LhzWOHIrRG3UMOTl8euucid-r1xLViplCt4_InnaOKF0Y0sonvtSqRI8C8jnb4IplF_r-2Y6YuC1sKWFjL-odpw4A/s1600/oracle_java_GL.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;193&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiv4_RgsJos3pUN4ZvQbL1dm-7nqdFXRSiK_e8mt8WJd1WtCOG_J6LhzWOHIrRG3UMOTl8euucid-r1xLViplCt4_InnaOKF0Y0sonvtSqRI8C8jnb4IplF_r-2Y6YuC1sKWFjL-odpw4A/s320/oracle_java_GL.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Algo que me pareció importante compartir es como podemos tener instalado el Oracla Java 7 en una distribución de GNU/Linux, para este ejemplo se utilizará Ubuntu 12.04, ya que normalmente las distribuciones como esta utiliza el OpenJDK, pero, y si deseo la versión de Oracle, qué hago, cómo lo instalo, está en los repositorios oficiales, es tal vez un archivo *.deb que se puede instalar fácilmente?, todas estas dudas surgieron en algunos compañeros cuando hicimos unos proyectos y para beneficio de todos, la respuesta será publicada en este post.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;
OpenJDK y el plugin IcedTea son mantenidos por la Comunidad y reciben actualizaciones periódicas. funciona bien para la mayoría de los propósitos,&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Lo más probable es que no necesitemos Oracle Java en absoluto, pero podemos vernos en la necesidad de instalarlo por X razón y esto es un problema, ya que fue retirado de los repositorios &quot;Partner&quot; por la revocación de la anterior licencia.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Explicaré un poco más de OpenJDK, ya que hay cierta confusión con los tipos de paquetes y sus siglas JRE y JDK y de paso nos servirá para tener las cosas claras en la instalación de Oracle Java, incluso puedes ampliar sobre este tema en una &lt;a href=&quot;http://gl-epn-programacion-ii.blogspot.com/2010/03/jvm-jdk-jre-conceptos-fundamentales-de.html&quot; target=&quot;_blank&quot;&gt;publicación anterior de mi blog&lt;/a&gt;:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
En los repositorios oficiales de Ubuntu tenemos 2 versiones de Java, la 6 y la 7, además del plugin &quot;icedtea&quot;:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Y aquí es donde se produce la confusión, ya que cada versión dispone de 2 paquetes: &amp;nbsp;JRE &amp;amp; JDK&lt;/div&gt;
&lt;ul&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;Para la versión 6 tenemos 2 paquetes: &quot;openjdk-6-jre&quot; y &quot;openjdk-6-jdk&quot;&lt;/li&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;Para la versión 7 tenemos 2 paquetes: &quot;openjdk-7-jre&quot; y &quot;openjdk-7-jdk&quot;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Para un mejor entendimiento, especifico los distintos paquetes de Java:&amp;nbsp;&lt;/div&gt;
&lt;ul&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;JDK(Java Development Kit)-&amp;gt;Kit de desarrollo Java, esta es la versión para los desarrolladores. Incluye el compilador de Java (javac) que mencioné como usar en &lt;a href=&quot;http://gl-epn-programacion-ii.blogspot.com/2013/01/como-ejecutar-java-desde-la-consola-cmd.html&quot; target=&quot;_blank&quot;&gt;entradas anteriores&lt;/a&gt;,&amp;nbsp;JRE y JVM.&lt;/li&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;JRE(Java Runtime Environment)-&amp;gt;Entorno de ejecución Java, esta es la versión para los usuarios normales que solo quieren poder ejecutar aplicaciones Java en su equipo, posee un conjunto de utilidades de Java, que actúa como un &quot;intermediario&quot; entre el sistema operativo y Java., también incluye la JVM.&lt;/li&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;JVM(Java Virtual Machine)-&amp;gt;Máquina Virtual de Java, es un Programa que ejecuta el código Java previamente compilado (bytecode) mientras que las librerías de clase estándar son las que implementan el API de Java. Ambas JVM y API deben ser consistentes entre sí, de ahí que sean distribuidas de modo conjunto.&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
La mayoría de los usuarios solo deben de instalar la JRE, y los desarrolladores deberán instalar la JDK, asegurándose de tener la misma versión de java y javac, también se listan a continuación algunos comandos que pueden ser muy útiles para controlar Java:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Mostrar la versión del entorno de Java &quot;Runtime&quot; (JRE):&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;java -version&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Mostrar la versión del compilador de Java &quot;Javac&quot; (JDK):&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;javac -version&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Permite seleccionar la versión de Java Runtime (JRE), si tenemos varias (no del compilador &quot;javac&quot;)&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;sudo /usr/sbin/update-alternatives --config java&lt;/i&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Terminada la explicación de OpenJDK vamos a empezar con la Instalación de Oracle Java:&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Añadimos los repositorios con:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;sudo add-apt-repository ppa:webupd8team/java&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Luego los actualizamos con:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;sudo apt-get update&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Con este comando instalamos Oracle Java 7:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;sudo apt-get install oracle-java7-installer&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Para comprobar que la instalación ha tenido&amp;nbsp;éxito,&amp;nbsp;ejecuta en una terminal el comando para saber la versión de Java que utiliza tu Ubuntu:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;java -version&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
La terminal te debe devolver algo parecido a esto (el último número de la versión (_12), puede variar):&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;java version &quot;1.7.0_12&quot;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;Java(TM) SE Runtime Environment (build 1.7.0_04-b20)&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;Java HotSpot(TM) Server VM (build 23.0-b21, mixed mode)&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Si tienes otro Java instalado puede ser que te responda con esa versión, para seleccionar la versión de Oracle Java, ejecuta:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;sudo update-alternatives --config java&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Y seleccionas la opción que necesites, Si no funciona, puedes desinstalarlo con:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;sudo apt-get remove oracle-java7-installer&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Y quitar los repositorios con estos 2 comandos:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;sudo apt-get install ppa-purge&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;sudo ppa-purge ppa:webupd8team/java&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
En caso de que el método anterior no te haya funcionado, también podemos hacerlo de forma manual, para lo cual debemos seguir los siguientes pasos, empieza por descargar el Oracle Java desde su &lt;a href=&quot;http://www.oracle.com/technetwork/es/java/javase/downloads/index.html&quot; target=&quot;_blank&quot;&gt;sitio Oficial&lt;/a&gt;, puede ser el JDK o JRE, abajo está la forma de instalar ambos.&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;Instalación de JRE para Usuarios Finales&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Una vez seleccionada la página de descarga de JRE, activamos la casilla para aceptar la licencia y seleccionamos el paquete para Linux &quot;.tar.gz&quot; de 32 bits &quot;jre-[version]-linux-i586.tar.gz&quot; o 64 bits &quot;jre-[version]-linux-x64.tar.gz&quot;, según sea la arquitectura de nuestro Ubuntu. En este ejemplo voy a instalar: &amp;nbsp;jre-7u12-linux-x64.tar.gz (versión 7u12 para 64 bits)&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
El número de versión &quot;[versión]&quot; puede variar dependiendo del momento en que leas el post.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Los comandos a continuación deben de ser modificados con el nombre del archivo exacto que tú te hayas descargado, ya que puede variar la versión y la arquitectura.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Una vez descargado en nuestra carpeta personal (es decir en &quot;/home/miUsuario/&quot;, no en la carpeta Descargas), lo descomprimimos con el comando:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;tar -xvf jre-7u12-linux-x64.tar.gz&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Si no lo tenemos, creamos un directorio &quot;/jvm/jdk1.7.0&quot; en &quot;/usr/lib&quot;, donde moveremos la carpeta descomprimida:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;sudo mkdir -p /usr/lib/jvm/jre1.7.0&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Movemos la carpeta descomprimida al directorio creado:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;sudo mv jre1.7.0_12/* /usr/lib/jvm/jre1.7.0/&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Ejecutamos el siguiente comando para java:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jre1.7.0/bin/java 0&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Si hemos instalado OpenJDK u otras versiones de Java (la 6), debemos decirle al sistema que utilice jdk1.7.0 de Oracle con el comando:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;sudo update-alternatives --config java&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
La terminal nos responderá algo similar a esto:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;Hay 3 opciones para la alternativa java (proporcionando /usr/bin/java).&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;Selección Ruta Prioridad Estado&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;------------------------------------------------------------&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;0 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 modo automático&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;1 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 modo manual&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;2 /usr/lib/jvm/java-6-sun/jre/bin/java 63 modo manual&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;* 3 /usr/lib/jvm/jre1.7.0/jre/bin/java 12 modo manual&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;Presione Entrar para mantener la opción actual [*], o escriba el número de la selección:&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Seleccionamos la opción que contenga &quot;jre1.7.0&quot;. En el ejemplo es la opción 3, escribimos 3 y presionamos Enter.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Instalar el plugin, para el navegador Mozilla Firefox:&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
En primer lugar, debemos de eliminar anteriores plugin de Java:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;rm -f ~/.mozilla/plugins/libnpjp2.so ~/.mozilla/plugins/libjavaplugin_oji.so&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;sudo rm -f /usr/lib/firefox/plugins/libnpjp2.so /usr/lib/firefox/plugins/libjavaplugin_oji.so&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Creamos el directorio para los plugins, si no lo tenemos:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;mkdir -p ~/.mozilla/plugins&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Ahora, vamos a crear un enlace simbólico para el nuevo Java en el directorio de plugins de Mozilla:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
- Para 64 bit:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;ln -s /usr/lib/jvm/jdk1.7.0/jre/lib/amd64/libnpjp2.so ~/.mozilla/plugins/&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
- Para 32 bit, sería:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;ln -s /usr/lib/jvm/jre1.7.0/lib/i386/libnpjp2.so ~/.mozilla/plugins/&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;Instalación de JDK para Desarrolladores&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Una vez seleccionada la página de descarga de JDK, activamos la casilla para aceptar la licencia y seleccionamos el paquete para Linux &quot;.tar.gz&quot; de 32 bits &quot;jdk-[version]-linux-i586.tar.gz&quot; o 64 bits &quot;jdk-[version]-linux-x64.tar.gz&quot;, según sea la arquitectura de nuestro Ubuntu. En este ejemplo voy a instalar: jdk-7u12-linux-x64.tar.gz (versión 7u12 para 64 bits)&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
El número de versión &quot;[versión]&quot; puede variar de acuerdo al tiempo en que leas este post.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Los comandos a continuación deben de ser modificados con el nombre del archivo exacto que tú te hayas descargado, ya que puede variar la versión y la arquitectura.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Una vez descargado en nuestra carpeta personal (es decir &quot;/home/miUsuario/&quot;, no en la carpeta Descargas), lo descomprimimos con el comando:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;tar -xvf jdk-7u12-linux-x64.tar.gz&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Si no lo tenemos, creamos un directorio &quot;/jvm/jdk1.7.0&quot; en &quot;/usr/lib&quot;, donde moveremos la carpeta descomprimida:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;sudo mkdir -p /usr/lib/jvm/jdk1.7.0&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Movemos la carpeta descomprimida al directorio creado:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;sudo mv jdk1.7.0_12/* /usr/lib/jvm/jdk1.7.0/&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Ejecutamos los siguientes comandos para java, javac (compilador) y javaws, respectivamente:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;sudo update-alternatives --install &quot;/usr/bin/java&quot; &quot;java&quot; &quot;/usr/lib/jvm/jdk1.7.0/bin/java&quot; 1&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;sudo update-alternatives --install &quot;/usr/bin/javac&quot; &quot;javac&quot; &quot;/usr/lib/jvm/jdk1.7.0/bin/javac&quot; 1&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;sudo update-alternatives --install &quot;/usr/bin/javaws&quot; &quot;javaws&quot; &quot;/usr/lib/jvm/jdk1.7.0/bin/javaws&quot; 1&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Si hemos instalado OpenJDK u otras versiones de Java (la 6), debemos decirle al sistema que utilice jdk1.7.0 de Oracle con el comando:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;sudo update-alternatives --config java&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
La terminal nos dará como resultado algo similar a esto:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;Hay 3 opciones para la alternativa java (proporcionando /usr/bin/java).&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;Selección Ruta Prioridad Estado&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;------------------------------------------------------------&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;0 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 modo automático&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;1 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 modo manual&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;2 /usr/lib/jvm/java-6-sun/jre/bin/java 63 modo manual&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;* 3 /usr/lib/jvm/jdk1.7.0/jre/bin/java 12 modo manual&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;Presione Entrar para mantener la opción actual [*], o escriba el número de la selección:&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Seleccionamos la opción que contenga &quot;jdk1.7.0&quot;. En este caso como es la 3, escribimos 3 y pulsamos Enter.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Instalar el plugin, para el navegador Mozilla Firefox:&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
En primer lugar, debemos de eliminar anteriores plugin de Java:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;rm -f ~/.mozilla/plugins/libnpjp2.so ~/.mozilla/plugins/libjavaplugin_oji.so&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;sudo rm -f /usr/lib/firefox/plugins/libnpjp2.so /usr/lib/firefox/plugins/libjavaplugin_oji.so&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Creamos el directorio para los plugins, si no lo tenemos:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;mkdir -p ~/.mozilla/plugins&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Ahora, vamos a crear un enlace simbólico para el nuevo Java en el directorio de plugins de Mozilla:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
- Para 64 bit:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;ln -s /usr/lib/jvm/jdk1.7.0/jre/lib/amd64/libnpjp2.so ~/.mozilla/plugins/&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
- Para 32 bit, sería:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;ln -s /usr/lib/jvm/jdk1.7.0/jre/lib/i386/libnpjp2.so ~/.mozilla/plugins/&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Y para finalizar podemos verificar la instalación desde la página de Oracle:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;http://www.java.com/es/download/installed.jsp&lt;/i&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://gl-epn-programacion-ii.blogspot.com/feeds/3448348932565113927/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2013/03/instalar-oracle-java-7-en-ubuntu-1204.html#comment-form' title='4 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/3448348932565113927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/3448348932565113927'/><link rel='alternate' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2013/03/instalar-oracle-java-7-en-ubuntu-1204.html' title='Instalar Oracle Java 7 en Ubuntu 12.04'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiv4_RgsJos3pUN4ZvQbL1dm-7nqdFXRSiK_e8mt8WJd1WtCOG_J6LhzWOHIrRG3UMOTl8euucid-r1xLViplCt4_InnaOKF0Y0sonvtSqRI8C8jnb4IplF_r-2Y6YuC1sKWFjL-odpw4A/s72-c/oracle_java_GL.jpg" height="72" width="72"/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3949108534218115935.post-2409829977237473620</id><published>2013-02-03T23:16:00.000-05:00</published><updated>2013-03-24T23:17:45.740-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="archivos"/><category scheme="http://www.blogger.com/atom/ns#" term="class"/><category scheme="http://www.blogger.com/atom/ns#" term="cmd"/><category scheme="http://www.blogger.com/atom/ns#" term="compiling"/><category scheme="http://www.blogger.com/atom/ns#" term="executing"/><category scheme="http://www.blogger.com/atom/ns#" term="jar"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="temp.mf"/><title type='text'>Cómo Crear un Jar con Java desde la Consola (cmd) en Windows (Todas las Versiones)</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;color: #0b5394; font-family: Trebuchet MS, Verdana, Arial, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 18.90625px;&quot;&gt;&lt;b&gt;Cómo Crear un Jar con Java desde la Consola (cmd) en Windows&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;b style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, Verdana, Arial, sans-serif; line-height: 18.90625px;&quot;&gt;(Todas las Versiones)&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgolanS-Zli0-i_rGnnfo2gMQDaa9DSKamFWrilOIb8zRs5dWp2UFnrD-DB-gNZZ40YgamHXsMbIonmDSWZ_CB1UKp1ZnZ3K0_VLQjymO8IJWJ4AZp4B3vv-ylZYWwcrJ-p_o9GmvN_5kQ/s1600/JAR+File+GL.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgolanS-Zli0-i_rGnnfo2gMQDaa9DSKamFWrilOIb8zRs5dWp2UFnrD-DB-gNZZ40YgamHXsMbIonmDSWZ_CB1UKp1ZnZ3K0_VLQjymO8IJWJ4AZp4B3vv-ylZYWwcrJ-p_o9GmvN_5kQ/s200/JAR+File+GL.png&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;Esta publicación es una continuación de la Entrada &quot;&lt;/span&gt;&lt;a href=&quot;http://gl-epn-programacion-ii.blogspot.com/2013/01/como-ejecutar-java-desde-la-consola-cmd.html&quot; style=&quot;text-align: justify;&quot; target=&quot;_blank&quot;&gt;Cómo Ejecutar Java desde la Consola (cmd) en Windows (Todas las Versiones)&lt;/a&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;&quot;, hoy veremos como crear un archivo con extensión Jar a partir de la línea de comandos, es decir sin depender de los IDEs más conocidos como Netbeans o Eclipse.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Para crear los archivos .jar debemos primero crear un Archivo de&amp;nbsp;Manifiesto&amp;nbsp; en el cual se deberá poner el nombre de la clase que contenga el método main, este archivo en Windows puede ser creado a partir del Bloc de Notas, entonces abrimos el Notepad (Bloc de Notas) y escribimos lo siguiente:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;Main-Class: HolaMundo&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;Sealed: true&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;*Nótese que no se agrega el .class y que la palabra MAIN-CLASS: es obligatoria.&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Donde HolaMundo es el Nombre de la Clase que tiene mi método main, una vez escrito eso lo guardamos con el siguiente nombre en el mismo lugar donde tenemos nuestros archivos .java y .class:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;temp.mf&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Ahora que tenemos todo listo para construir el .jar vamos a la línea de comandos (CMD) y ejecutamos la siguiente sentencia:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;jar -cf HolaMundo.jar HolaMundo.class&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Después de haber ejecutado la sentencia anterior ya tendremos el archivo HolaMundo.jar en nuestro directorio, y contendrá el fichero de manifiesto, la clase o clases que tenga nuestro proyecto, ahora al archivo .jar que tenemos, vamos a modificarlo para indicarle que archivo de manifiesto debe usar, esto con la siguiente sentencia:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;jar cmf temp.mf HolaMundo.jar HolaMundo.class&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;div&gt;
Se permiten comodines (por ejemplo, para incluir todos los archivos class de la carpeta o que cumplan con alguna condición dada):&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;i&gt;jar cmf temp.mf HolaMundo.jar fichero$.class&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;jar cmf temp.mf HolaMundo.jar *.class&lt;/i&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Y finalmente ejecutamos nuestro archivo en la línea de comandos con la siguiente llamada:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;java -jar HolaMundo.jar&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
Les adjunto una captura de todos los pasos antes mencionados al final del post, para que tengan una mejor idea del Proceso llevado a cabo, les recuerdo que solo empezamos con los archivos:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;HolaMundo.java&lt;/li&gt;
&lt;li&gt;temp.mf&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Y a partir de la ejecución de los comandos&amp;nbsp;terminamos&amp;nbsp;con los siguientes archivos:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;HolaMundo.java&lt;/li&gt;
&lt;li&gt;temp.mf&lt;/li&gt;
&lt;li&gt;HolaMundo.class&lt;/li&gt;
&lt;li&gt;HolaMundo.jar&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Cualquier duda la pueden hacer en los comentarios.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUjR07LGXBRcDsQIkbgEyYdT8VDUGvWrfAaHZCXHUzrLh_ixYbb5nL837TPgIouqWZnnZXGjH2luN38E-sv_OuzZv9iznmk6V-t2ICv25Db2trd-wHg-xczNZ9MNlCBKjC0PJAyT58e6w/s1600/Jar_Java_Javac_CMD_GL_Hackem.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;202&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUjR07LGXBRcDsQIkbgEyYdT8VDUGvWrfAaHZCXHUzrLh_ixYbb5nL837TPgIouqWZnnZXGjH2luN38E-sv_OuzZv9iznmk6V-t2ICv25Db2trd-wHg-xczNZ9MNlCBKjC0PJAyT58e6w/s400/Jar_Java_Javac_CMD_GL_Hackem.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
Crear un Jar desde la Consola (CMD)&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gl-epn-programacion-ii.blogspot.com/feeds/2409829977237473620/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2013/02/como-crear-un-jar-con-java-desde-la.html#comment-form' title='15 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/2409829977237473620'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/2409829977237473620'/><link rel='alternate' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2013/02/como-crear-un-jar-con-java-desde-la.html' title='Cómo Crear un Jar con Java desde la Consola (cmd) en Windows (Todas las Versiones)'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgolanS-Zli0-i_rGnnfo2gMQDaa9DSKamFWrilOIb8zRs5dWp2UFnrD-DB-gNZZ40YgamHXsMbIonmDSWZ_CB1UKp1ZnZ3K0_VLQjymO8IJWJ4AZp4B3vv-ylZYWwcrJ-p_o9GmvN_5kQ/s72-c/JAR+File+GL.png" height="72" width="72"/><thr:total>15</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3949108534218115935.post-6583062829934839144</id><published>2013-01-15T21:33:00.000-05:00</published><updated>2013-03-24T23:10:54.681-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="cmd"/><category scheme="http://www.blogger.com/atom/ns#" term="compiling"/><category scheme="http://www.blogger.com/atom/ns#" term="eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="javac"/><category scheme="http://www.blogger.com/atom/ns#" term="netbeans"/><category scheme="http://www.blogger.com/atom/ns#" term="shell"/><category scheme="http://www.blogger.com/atom/ns#" term="terminal"/><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><title type='text'>Cómo Compilar y Ejecutar archivos Java desde la Consola (cmd) en Windows (Todas las Versiones)</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: #0b5394; font-family: Trebuchet MS, Verdana, Arial, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large; line-height: 18.90625px;&quot;&gt;&lt;b&gt;Cómo Compilar y Ejecutar archivos Java desde la Consola (cmd) en Windows (Todas las Versiones)&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: #0b5394; font-family: Trebuchet MS, Verdana, Arial, sans-serif; font-size: medium;&quot;&gt;&lt;span style=&quot;line-height: 18.90625px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6aSAC4-n_yXjoNrHOZKAsZphZCPlDPRjhOtIfRDSi7SGg0lgzqgK02V2nXFCNJ9cyMCb1CvneXOdGWkQ2iBlXN5yTNKeCuzDTgBa272gcE-pl2FC8lEmRLu9LGS_1eSpag6uFKt-azAc/s1600/java-cmd-GL-logo.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;161&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6aSAC4-n_yXjoNrHOZKAsZphZCPlDPRjhOtIfRDSi7SGg0lgzqgK02V2nXFCNJ9cyMCb1CvneXOdGWkQ2iBlXN5yTNKeCuzDTgBa272gcE-pl2FC8lEmRLu9LGS_1eSpag6uFKt-azAc/s400/java-cmd-GL-logo.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Buenas noches a todos, en este post les voy a compartir como podemos compilar y ejecutar archivos de java desde la Consola de Windows (cmd o símbolo del sistema), esto sirve para todas las ediciones de Windows (probado desde Windows XP hasta Windows 8).&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Lo primero que debes hacer es tener le última versión estable del JDK, la cual te puedes bajar del sitio web oficial:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;a href=&quot;http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html?ssSourceSiteId=otnes&quot; target=&quot;_blank&quot;&gt;Java SE Development Kit 7 Downloads&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Una vez que lo hayas bajado e instalado correctamente, procede a buscar la ruta de instalación por ejemplo:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace; font-size: 13px; line-height: 14.296875px; white-space: pre;&quot;&gt;    1 | C:\Program Files\Java\jdk1.7.0_02\bin&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Esa dirección es la ruta que tendremos que agregar a la variable de entorno &lt;i&gt;Path, &lt;/i&gt;para ello debemos ir a:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Mi PC -&amp;gt; Click derecho -&amp;gt; Propiedades -&amp;gt; [Pestaña] Opciones Avanzadas -&amp;gt; Variables de Entorno&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Equipo -&amp;gt; Click derecho -&amp;gt; Propiedades -&amp;gt; Configuración Avanzada del Sistema -&amp;gt; [Pestaña] Opciones Avanzadas -&amp;gt; Variables de Entorno&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Buscamos en el cuadro mostrado la variable de nombre &lt;i&gt;Path, &lt;/i&gt;presionamos &lt;i&gt;Editar&lt;/i&gt;, en el cuadro mostrado, nos vamos hasta el final del texto que ya está escrito y agregamos lo siguiente sin las comillas:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace; font-size: 13px; line-height: 14.296875px; white-space: pre;&quot;&gt;&quot;;C:\Program Files\Java\jdk1.7.0_02\bin;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Quedando algo similar a lo mostrado en la siguiente imagen:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4eb28Y1SY5g7cMQIdbQhHTNLCDT5Y3B_ZSEsNSKLNjtjMAW6te5UsGnojFAKHRNZl7h18_BDcLCHfYEd_iAeFHcfwxOU6Fzit8JKx8eUaJ_4r_Om3aAa_-q0yZ6Vss7RnrHSVvlwIfYo/s1600/Variables_de_Entorno_Java_Hackem.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4eb28Y1SY5g7cMQIdbQhHTNLCDT5Y3B_ZSEsNSKLNjtjMAW6te5UsGnojFAKHRNZl7h18_BDcLCHfYEd_iAeFHcfwxOU6Fzit8JKx8eUaJ_4r_Om3aAa_-q0yZ6Vss7RnrHSVvlwIfYo/s400/Variables_de_Entorno_Java_Hackem.png&quot; width=&quot;358&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
Editando la Variable de Entorno &lt;i&gt;Path, &lt;/i&gt;para agregar Java (Windows 7)&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Una vez que hayamos añadido la ruta, presionamos OK, luego nuevamente OK e iniciamos una consola (cmd) y escribimos javac, nos&amp;nbsp;debería&amp;nbsp;salir algo&amp;nbsp;así:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhE-IXDnBN0nVcTYx06S_lrEH9eLui7Rdrcs5AUYRrO0rHd_dG4uTd75oLoBXXD45yHLsl__-woZDa-vw1fmj8Cp9iTGZFnZ1CFcdaYtXZGIr31-phgztNV4g5T0PzqOlbYOJ5le4JJQtw/s1600/Javac_CMD_Hackem.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;202&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhE-IXDnBN0nVcTYx06S_lrEH9eLui7Rdrcs5AUYRrO0rHd_dG4uTd75oLoBXXD45yHLsl__-woZDa-vw1fmj8Cp9iTGZFnZ1CFcdaYtXZGIr31-phgztNV4g5T0PzqOlbYOJ5le4JJQtw/s400/Javac_CMD_Hackem.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
Ejecución de Javac desde el CMD (Windows 8)&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Si te salió algo similar a la imagen superior es que el proceso se realizó correctamente y que Java está bien instalado y configurado en tu computador, como simple prueba de concepto vamos a crear un Hola Mundo.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Abrimos el Bloc de Notas (Como saben, no se requiere de un IDE al 100% para programar en Java), y escribimos el siguiente código:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-collapse: collapse; border-spacing: 0px; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: #444444; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 13px; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 680px;&quot;&gt;&lt;tbody style=&quot;background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;tr style=&quot;background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;td class=&quot;gutter&quot; style=&quot;background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(175, 175, 175) !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot; style=&quot;background-color: white !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-right-color: rgb(108, 226, 108) !important; border-right-style: solid !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border-width: 0px 3px 0px 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 0.5em 0px 1em !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
1&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot; style=&quot;background-color: white !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-right-color: rgb(108, 226, 108) !important; border-right-style: solid !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border-width: 0px 3px 0px 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 0.5em 0px 1em !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
2&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot; style=&quot;background-color: white !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-right-color: rgb(108, 226, 108) !important; border-right-style: solid !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border-width: 0px 3px 0px 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 0.5em 0px 1em !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
3&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot; style=&quot;background-color: white !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-right-color: rgb(108, 226, 108) !important; border-right-style: solid !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border-width: 0px 3px 0px 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 0.5em 0px 1em !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
4&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot; style=&quot;background-color: white !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-right-color: rgb(108, 226, 108) !important; border-right-style: solid !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border-width: 0px 3px 0px 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 0.5em 0px 1em !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
5&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot; style=&quot;background-color: white !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-right-color: rgb(108, 226, 108) !important; border-right-style: solid !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border-width: 0px 3px 0px 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 0.5em 0px 1em !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
6&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot; style=&quot;background-color: white !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-right-color: rgb(108, 226, 108) !important; border-right-style: solid !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border-width: 0px 3px 0px 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 0.5em 0px 1em !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
7&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot; style=&quot;background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 650px;&quot;&gt;&lt;div class=&quot;container&quot; style=&quot;background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: relative !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot; style=&quot;background-color: white !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;java keyword&quot; style=&quot;background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;class&lt;/code&gt; &lt;code class=&quot;java plain&quot; style=&quot;background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;HolaMundo&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot; style=&quot;background-color: white !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;java plain&quot; style=&quot;background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;{&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot; style=&quot;background-color: white !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;java keyword&quot; style=&quot;background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt; public&lt;/code&gt; &lt;code class=&quot;java keyword&quot; style=&quot;background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;static&lt;/code&gt; &lt;code class=&quot;java keyword&quot; style=&quot;background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;void&lt;/code&gt; &lt;code class=&quot;java plain&quot; style=&quot;background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;main(String[] args)&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot; style=&quot;background-color: white !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;java plain&quot; style=&quot;background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt; {&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot; style=&quot;background-color: white !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;java plain&quot; style=&quot;background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;  System.out.println(&lt;/code&gt;&lt;code class=&quot;java string&quot; style=&quot;background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: blue !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&quot;Hola Mundo!&quot;&lt;/code&gt;&lt;code class=&quot;java plain&quot; style=&quot;background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot; style=&quot;background-color: white !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;java plain&quot; style=&quot;background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt; }&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot; style=&quot;background-color: white !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;java plain&quot; style=&quot;background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;}&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Luego guardamos el archivo con el nombre &quot;HolaMundo.java&quot;, en mi caso lo guardé en la raíz del disco duro, es decir en: &quot;C:\HolaMundo.java&quot;, para compilarlo ejecutamos la siguiente sentencia:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;javac HolaMundo.java&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Esto nos genera un archivo HolaMundo.class, y para ejecutar el código compilado en la Consola escribimos:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;java HolaMundo&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Muy importante, no se coloca la extensión del archivo (es decir el .class)&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUua2mLrYtK-dnamX2rvZZjKu7gBSqJ87RPjMDBh1oEGZ6HE9C4UwZCDQoDRqMy02AJAiLnzjIA3nwi8FfvW9sLuRWCmqI7I_AkcLDMm41htzkkucr7U2oRxEJGwTg30YsDA52NcoRd9E/s1600/Javac_Java_CMD_Hackem.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;202&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUua2mLrYtK-dnamX2rvZZjKu7gBSqJ87RPjMDBh1oEGZ6HE9C4UwZCDQoDRqMy02AJAiLnzjIA3nwi8FfvW9sLuRWCmqI7I_AkcLDMm41htzkkucr7U2oRxEJGwTg30YsDA52NcoRd9E/s400/Javac_Java_CMD_Hackem.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
En la siguiente entrada publicaré como crear a partir de lo que tenemos hasta ahora un archivo.jar y así mismo como ejecutarlos desde la línea de comandos.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gl-epn-programacion-ii.blogspot.com/feeds/6583062829934839144/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2013/01/como-ejecutar-java-desde-la-consola-cmd.html#comment-form' title='65 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/6583062829934839144'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/6583062829934839144'/><link rel='alternate' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2013/01/como-ejecutar-java-desde-la-consola-cmd.html' title='Cómo Compilar y Ejecutar archivos Java desde la Consola (cmd) en Windows (Todas las Versiones)'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6aSAC4-n_yXjoNrHOZKAsZphZCPlDPRjhOtIfRDSi7SGg0lgzqgK02V2nXFCNJ9cyMCb1CvneXOdGWkQ2iBlXN5yTNKeCuzDTgBa272gcE-pl2FC8lEmRLu9LGS_1eSpag6uFKt-azAc/s72-c/java-cmd-GL-logo.jpg" height="72" width="72"/><thr:total>65</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3949108534218115935.post-4877735873218212128</id><published>2012-12-12T18:44:00.000-05:00</published><updated>2013-07-24T18:43:00.163-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="algorithm"/><category scheme="http://www.blogger.com/atom/ns#" term="archivos"/><category scheme="http://www.blogger.com/atom/ns#" term="criptografia"/><category scheme="http://www.blogger.com/atom/ns#" term="crypto"/><category scheme="http://www.blogger.com/atom/ns#" term="DES"/><category scheme="http://www.blogger.com/atom/ns#" term="download"/><category scheme="http://www.blogger.com/atom/ns#" term="eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="ficheros"/><category scheme="http://www.blogger.com/atom/ns#" term="files"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="netbeans"/><title type='text'>Cifrado de DES en Java</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #0b5394; font-family: &#39;Trebuchet MS&#39;, Verdana, Arial, sans-serif; line-height: 18.90625px;&quot;&gt;&lt;b&gt;Cifrado de DES&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;background-color: white; color: #0b5394; font-family: &#39;Trebuchet MS&#39;, Verdana, Arial, sans-serif; line-height: 18.90625px; text-align: center;&quot;&gt;&amp;nbsp;en Java&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b style=&quot;background-color: white; color: #0b5394; font-family: &#39;Trebuchet MS&#39;, Verdana, Arial, sans-serif; font-size: large; line-height: 18.90625px; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://upload.wikimedia.org/wikipedia/commons/thumb/b/bd/Board300.jpg/572px-Board300.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;http://upload.wikimedia.org/wikipedia/commons/thumb/b/bd/Board300.jpg/572px-Board300.jpg&quot; width=&quot;190&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
En esta ocasión les comparto la implementación del Cifrado DES (Data Encryption Standard) realizado en Java,  si no lo conocen en detalle o nunca escucharon de él como siempre veremos un resumen en la parte inferior, pero si quieren adentrar mucho más en el tema pueden acceder &lt;a href=&quot;http://en.wikipedia.org/wiki/Data_Encryption_Standard&quot;&gt;aquí&lt;/a&gt;.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Trebuchet MS&#39;, Verdana, Arial, sans-serif; font-size: 13px; line-height: 18.90625px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em; text-align: justify;&quot;&gt;
&lt;i&gt;&quot;Data Encryption Standard&amp;nbsp;(DES) es un algoritmo de cifrado, es decir, un método para&amp;nbsp;cifrar&amp;nbsp;información, escogido como un estándar&amp;nbsp;FIPS&amp;nbsp;en los&amp;nbsp;Estados Unidos&amp;nbsp;en&amp;nbsp;1976, y cuyo uso se ha propagado ampliamente por todo el mundo. Posteriormente DES fue sometido a un intenso análisis académico y motivó el concepto moderno del&amp;nbsp;cifrado por bloques&amp;nbsp;y su&amp;nbsp;criptoanálisis.&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em; text-align: justify;&quot;&gt;
&lt;i&gt;&lt;/i&gt;&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em; text-align: justify;&quot;&gt;
&lt;i&gt;Hoy en día, DES se considera inseguro para muchas aplicaciones. Esto se debe principalmente a que el tamaño de clave de 56 bits es corto; las claves de DES se han roto en menos de 24 horas. Existen también resultados analíticos que demuestran debilidades teóricas en su cifrado, aunque son inviables en la práctica. Se cree que el algoritmo es seguro en la práctica en su variante de&amp;nbsp;&lt;a href=&quot;http://es.wikipedia.org/wiki/Triple_DES&quot; style=&quot;background-image: none; background-position: initial initial; background-repeat: initial initial; color: #0b0080; text-decoration: none;&quot; title=&quot;Triple DES&quot;&gt;Triple DES&lt;/a&gt;, aunque existan ataques teóricos.&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em; text-align: justify;&quot;&gt;
&lt;i&gt;Desde hace algunos años, el algoritmo ha sido sustituido por el nuevo&amp;nbsp;&lt;a href=&quot;http://es.wikipedia.org/wiki/Advanced_Encryption_Standard&quot; style=&quot;background-image: none; background-position: initial initial; background-repeat: initial initial; color: #0b0080; text-decoration: none;&quot; title=&quot;Advanced Encryption Standard&quot;&gt;AES&lt;/a&gt;&amp;nbsp;(Advanced Encryption Standard).&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em; text-align: justify;&quot;&gt;
&lt;i&gt;En algunas ocasiones, DES es denominado también&amp;nbsp;DEA&amp;nbsp;(Data Encryption Algorithm).&quot;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Si desean profundizar en Seguridad Informática, especificamente en 
Aplicaciones Web les recomiendo que visiten las siguientes páginas y se 
suscriban:&lt;/div&gt;
&lt;ul style=&quot;text-align: justify;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://www.facebook.com/hackem.epn&quot; target=&quot;_blank&quot;&gt;Hackem Research Group&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.facebook.com/owasp.ecuador&quot;&gt;OWASP Ecuador Chapter - EPN&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Los Sitios pertenecen a la Comunidad de Software Libre y 
Seguridad Informática [Hackem], y la Escuela Politécnica Nacional (EPN) 
es actualmente la sede de OWASP (Open Web Application Security Project) 
del Capítulo Nacional y del Capítulo Universitario de Ecuador gracias a 
Hackem Research Group, más información en los 2 enlaces antes 
mencionados.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
En esta Comunidad se suelen dar cursos y capacitaciones en áreas como Software Libre, GNU/Linux y Seguridad Informática y Ethical Hacking, incluso personas que residan en Ecuador pueden participar activamente de forma presencial.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Volviendo al tema, este es uno de los primeros algoritmos que se podría considerar ya de nivel complejo para analizar su funcionamiento y de como se aplican las rondas, a continuación se adjunta una imagen con la estructura básica de este algoritmo de cifrado:&lt;/div&gt;
&lt;span style=&quot;font-family: sans-serif; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: white; clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: sans-serif; font-size: x-small;&quot;&gt;&lt;a href=&quot;http://upload.wikimedia.org/wikipedia/commons/1/1f/DES-estructura-basica.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;http://upload.wikimedia.org/wikipedia/commons/1/1f/DES-estructura-basica.png&quot; width=&quot;120&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: sans-serif; font-size: x-small;&quot;&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
Estructura Básica de DES&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;div&gt;
Ahora cómo funcionaría esto en código Java?&lt;/div&gt;
&lt;div&gt;
El procedimiento básico a seguir sería:&lt;/div&gt;
&lt;div&gt;
1. Generar una clave DES aleatoria. (Usamos KeyGenerator)&lt;/div&gt;
&lt;div&gt;
2. Cifrar con DES nuestro mensaje (Ingresado por Consola o archivo), Usaremos DES/ECB/PKCS5Padding&lt;/div&gt;
&lt;div&gt;
3. Descifrar con DES nuestro mensaje (Desde un archivo o por Consola), Acá es el procedimiento inverso, no cambia nada más.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
Ahora les incluyo parte del código de la función que utilizaremos para cifrar:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
cifrador.init(Cipher.ENCRYPT_MODE, clave);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
byte[] buffer = new byte[1000];&lt;/div&gt;
&lt;div&gt;
byte[] bufferCifrado;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
FileInputStream in = new FileInputStream(args[0]);&lt;/div&gt;
&lt;div&gt;
FileOutputStream out = new FileOutputStream(args[0]+&quot;.cifrado&quot;);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
int bytesLeidos = in.read(buffer, 0, 1000);&lt;/div&gt;
&lt;div&gt;
while (bytesLeidos != -1)&lt;/div&gt;
&lt;div&gt;
{&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;bufferCifrado = cifrador.update(buffer, 0, bytesLeidos);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;out.write(bufferCifrado);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;bytesLeidos = in.read(buffer, 0, 1000);&lt;/div&gt;
&lt;div&gt;
}&lt;/div&gt;
&lt;div&gt;
bufferCifrado = cifrador.doFinal();&lt;/div&gt;
&lt;div&gt;
out.write(bufferCifrado);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
in.close();&lt;/div&gt;
&lt;div&gt;
out.close();&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Y finalmente el código de la función inversa que descifra nuestro mensaje:&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
cifrador.init(Cipher.DECRYPT_MODE, clave);&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
in = new FileInputStream(args[0]+&quot;.cifrado&quot;);&lt;/div&gt;
&lt;div&gt;
out = new FileOutputStream(args[0]+&quot;.descifrado&quot;);&lt;/div&gt;
&lt;div&gt;
byte[] bufferPlano;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
bytesLeidos = in.read(buffer, 0, 1000);&lt;/div&gt;
&lt;div&gt;
while (bytesLeidos != -1)&lt;/div&gt;
&lt;div&gt;
{&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;bufferPlano = cifrador.update(buffer, 0, bytesLeidos);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;out.write(bufferPlano);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;bytesLeidos = in.read(buffer, 0, 1000);&lt;/div&gt;
&lt;div&gt;
}&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
bufferPlano = cifrador.doFinal();&lt;/div&gt;
&lt;div&gt;
out.write(bufferPlano);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
in.close();&lt;/div&gt;
&lt;div&gt;
out.close();&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Como siempre la solución completa se encuentra al final del blog en la Java Box, si tienen preguntas o inquietudes sobre el programa y su funcionamiento no duden en comentarlo.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Forma de Uso:&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Una vez compilado el archivo.jar procedemos a abrir un cmd (Terminal en GNU/Linux) y ejecutamos así:&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;i&gt;java -jar DES_Cipher.jar mensajeACifrar.txt&lt;/i&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
La salida en consola deberá ser similar al algoritmo que planteamos en la parte superior, se adjunta una captura:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlwOBNCP7fpxM49F6zZUgqzRD0wSf1XYdRywnthn3Ew6Cj0VZePEHATWsij6HB31yrIFgAOVtxnd0HqYbjpe61PxGJdKQZEK6iLOuCqPiz4ufmf6ihEfKWCMzsQbXObTk_9pbGoq29YuQ/s1600/Java_DES_Cipher_Hackem.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;130&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlwOBNCP7fpxM49F6zZUgqzRD0wSf1XYdRywnthn3Ew6Cj0VZePEHATWsij6HB31yrIFgAOVtxnd0HqYbjpe61PxGJdKQZEK6iLOuCqPiz4ufmf6ihEfKWCMzsQbXObTk_9pbGoq29YuQ/s400/Java_DES_Cipher_Hackem.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
Cómo pueden observar la llave es generada desde el programa de forma aleatoria, en el ejemplo utilice un archivo de entrada y obtuve los siguientes archivos finales con su respectivo contenido:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;b&gt;mensajeACifrar.txt&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;i&gt;Hola Mundo desde Java con DES! =)&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;b&gt;mensajeACifrar.txt.cifrado&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;i&gt;»§õžê _ Ì&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;i&gt;øÂñÀ¡&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;ê  4²YÃCR u×üôûšëØ‚qì98&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;b&gt;mensajeACifrar.txt.descifrado&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;i&gt;Hola Mundo desde Java con DES! =)&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gl-epn-programacion-ii.blogspot.com/feeds/4877735873218212128/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2012/12/cifrado-de-des-en-java.html#comment-form' title='1 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/4877735873218212128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/4877735873218212128'/><link rel='alternate' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2012/12/cifrado-de-des-en-java.html' title='Cifrado de DES en Java'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlwOBNCP7fpxM49F6zZUgqzRD0wSf1XYdRywnthn3Ew6Cj0VZePEHATWsij6HB31yrIFgAOVtxnd0HqYbjpe61PxGJdKQZEK6iLOuCqPiz4ufmf6ihEfKWCMzsQbXObTk_9pbGoq29YuQ/s72-c/Java_DES_Cipher_Hackem.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3949108534218115935.post-5772644034122845735</id><published>2012-11-08T00:17:00.002-05:00</published><updated>2013-07-24T18:41:57.767-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="algorithm"/><category scheme="http://www.blogger.com/atom/ns#" term="criptografia"/><category scheme="http://www.blogger.com/atom/ns#" term="crypto"/><category scheme="http://www.blogger.com/atom/ns#" term="download"/><category scheme="http://www.blogger.com/atom/ns#" term="eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="netbeans"/><category scheme="http://www.blogger.com/atom/ns#" term="Vigenere"/><title type='text'>Cifrado de Vigenère en Java</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;div style=&quot;margin: 0px;&quot;&gt;
&lt;div style=&quot;margin: 0px;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;Cifrado de Vigen&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;è&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;color: #0b5394;&quot;&gt;re en Java&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-size: large;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;div style=&quot;margin: 0px;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;img height=&quot;212&quot; src=&quot;http://www.cryptomuseum.com/crypto/vigenere/img/300378/001/full.jpg&quot; width=&quot;320&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;div style=&quot;margin: 0px;&quot;&gt;
&lt;div style=&quot;margin: 0px;&quot;&gt;
Siguiendo con la serie de programas de criptografía realizados en Java, ahora veremos el Cifrado Vigenère si no lo conocen o no han profundizado en el tema, a continuación un breve resumen:&lt;br /&gt;
&lt;br /&gt;
&quot;&lt;i&gt;El cifrado Vigenère es un cifrado basado en diferentes series de caracteres o letras del cifrado César formando estos caracteres una tabla, llamada tabla de Vigenère, que se usa como clave. El cifrado de Vigenère es un cifrado de sustitución simple polialfabético.&lt;/i&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;i&gt;El cifrado Vigenère se ha reinventado muchas veces. El método original fue descrito por Giovan Battista Belasso en su libro de 1553 La cifra del Sig. Giovan Battista Belasso. Sin embargo, fue incorrectamente atribuido más tarde a Blaise de Vigenère, concretamente en el siglo XIX, y por ello aún se le conoce como el &quot;cifrado Vigenère&quot;.&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;Este cifrado es conocido porque es fácil de entender e implementar, además parece irresoluble; esto le hizo valedor del apodo el código indescifrable (le chiffre indéchiffrable, en francés).&lt;/i&gt;&lt;i style=&quot;background-color: white;&quot;&gt;&quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Si desean profundizar en Seguridad Informática, especificamente en Aplicaciones Web les recomiendo que visiten las siguientes páginas y se suscriban:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.facebook.com/hackem.epn&quot; target=&quot;_blank&quot;&gt;Hackem Research Group&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.facebook.com/owasp.ecuador&quot;&gt;OWASP Ecuador Chapter - EPN&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
Los Sitios pertenecen a la Comunidad de Software Libre y Seguridad Informática [Hackem], y la Escuela Politécnica Nacional (EPN) es actualmente la sede de OWASP (Open Web Application Security Project) del Capítulo Nacional y del Capítulo Universitario de Ecuador gracias a Hackem Research Group, más información en los 2 enlaces antes mencionados.&lt;br /&gt;
&lt;br /&gt;
Pero bueno, ahora entrando en&amp;nbsp;materia, el cifrado Vigenère ganó una gran reputación por ser excepcionalmente robusto. Incluso el escritor y matemático Charles Lutwidge Dodgson (Lewis Carroll) dijo que el cifrado Vigenère era irrompible en el artículo &quot;The Alphabet Cipher&quot; para una revista de niños. En 1917, &quot;Scientific American&quot; describió el cifrado Vigenère como imposible de romper. Esta reputación fue mantenida hasta que el método Kasiski resolvió el cifrado en el siglo XIX y algunos criptoanalistas habilidosos pudieron romper ocasionalmente el cifrado en el siglo XVI.&lt;br /&gt;
El cifrado Vigenère es lo suficientemente simple si se usa con discos de cifrado. Los Estados confederados de América, por ejemplo, utilizaron un disco de cifrado para implementar el cifrado Vigenère durante la Guerra Civil Estadounidense. Los mensajes confederados fueron poco secretos, ya que los miembros de la Unión solían descifrar los mensajes.&lt;br /&gt;
Gilbert Vernam trató de arreglar el cifrado (creando el cifrado Vernam-Vigenère en 1918), pero no importa lo que hiciera, el cifrado sigue siendo vulnerable al criptoanálisis.&lt;br /&gt;
&lt;br /&gt;
Veamos un ejemplo de un mensaje con una clave y cómo obtenemos el texto cifrado:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;pre style=&quot;background-color: #f9f9f9; border: 1px dashed rgb(47, 111, 171); font-family: monospace, Courier; font-size: 13px; line-height: 1.3em; padding: 1em; text-align: start;&quot;&gt;mensaje:      P A R I S  V A U T  B I E N
clave:        L O U P L  O U P L  O U P L
criptograma:  A O L X D  J U J E  P C T Y&lt;/pre&gt;
En este abecedario solo existen 26 letras donde A=0, B=1 , C=2 ... Z=25&lt;br /&gt;
En términos matemáticos puede expresarse como:&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;img alt=&quot;Yi= (Xi+Zi) mod T&quot; src=&quot;http://upload.wikimedia.org/math/f/1/d/f1dbbaf57af4fe054871adc4326bcb41.png&quot; /&gt;&lt;/div&gt;
Donde Xi es el numero de ubicación de la letra, es decir, que P le corresponde al numero 15 en modo horizontal y Zi la L en modo vertical le corresponde al numero 11, y la letra T es el total de números del alfabeto. Entonces la ecuación quedará de la siguiente manera: Yi= (15 + 11) mod 26. El resultado es: 0, donde 0 es igual a A en modo horizontal.&lt;br /&gt;
Se observa que a una misma letra en el texto claro le pueden corresponder diferentes letras en el texto cifrado.&lt;br /&gt;
&lt;br /&gt;
En base al ejemplo anterior podemos realizar la siguiente&amp;nbsp;función encargada de Cifrar el mensaje con la clave proporcionada:&lt;br /&gt;
&lt;br /&gt;
for (int ptextIndex = 0; ptextIndex &amp;lt; textoPlano.length(); ptextIndex++)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; char pChar = textoPlano.charAt(ptextIndex);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; int asciiVal = (int) pChar;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if (pChar == &#39; &#39;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
textoCifrado += pChar;&lt;br /&gt;
continue;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if (asciiVal &amp;lt; 65 || asciiVal &amp;gt; 90)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
textoCifrado += pChar;&lt;br /&gt;
continue;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; int basicPlainTextValue = ((int) pChar) - 65;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; char kChar = llave.charAt(llaveIndex);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; int basicLlaveValue = ((int) kChar) - 65;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; int tableEntry = tablaVigenere[basicPlainTextValue][basicLlaveValue];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; char cChar = (char) (tableEntry + 65);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; textoCifrado += cChar;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; llaveIndex++;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if (llaveIndex == llave.length())&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
llaveIndex = 0;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
Una vez realizada esta función, para hacer la versión que descifre el texto, solo debemos realizar las operaciones inversas:&lt;br /&gt;
&lt;br /&gt;
for (int ctextIndex = 0; ctextIndex &amp;lt; textoCifrado.length(); ctextIndex++)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; char cChar = textoCifrado.charAt(ctextIndex);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; int asciiVal = (int) cChar;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if (cChar == &#39; &#39;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; textoPlano += cChar;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; continue;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if (asciiVal &amp;lt; 65 || asciiVal &amp;gt; 90)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; textoPlano += cChar;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; continue;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; int basictextoCifradoValue = ((int) cChar) - 65;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; char kChar = llave.charAt(llaveIndex);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; int basicKeyValue = ((int) kChar) - 65;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; for (int pIndex = 0; pIndex &amp;lt; TamañoColumnaTabla; pIndex++)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (tablaVigenere[basicKeyValue][pIndex] == basictextoCifradoValue)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; char potcChar = (char) (tablaVigenere[basicKeyValue][pIndex] + 65);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; char potpChar = (char) (pIndex + 65);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; textoPlano += potpChar;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; llaveIndex++;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if (llaveIndex == llave.length())&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; llaveIndex = 0;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Los dos pedazos de código irían dentro de la clase &lt;i&gt;main &lt;/i&gt;o también pueden crearlas como funciones independientes, las cuales serían invocadas en el método principal de su programa. Próximamente si les interesa este ejemplo lo subiré al JavaBox.&lt;br /&gt;
&lt;br /&gt;
Y para terminar les adjunto una ejecución del programa tanto para cifrar como para descifrar una cadena de texto:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Cifrando el Mensaje:&lt;/b&gt;&lt;br /&gt;
Ingresa el Mensaje en Claro (Texto Plano):&lt;br /&gt;
&lt;i&gt;Hola Mundo!&lt;/i&gt;&lt;br /&gt;
Ingresa la Llave: &lt;i&gt;Secreto&lt;/i&gt;&lt;br /&gt;
El Texto Cifrado es: &lt;i&gt;ZSNR QNBVS!&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Descifrando el Mensaje:&lt;/b&gt;&lt;br /&gt;
Ingresa el Texto Cifrado:&lt;br /&gt;
&lt;i&gt;ZSNR QNBVS!&lt;/i&gt;&lt;br /&gt;
Ingresa la Llave: &lt;i&gt;Secreto&lt;/i&gt;&lt;br /&gt;
El Mensaje en Claro (Texto Plano) es: &lt;i&gt;Hola Mundo!&lt;/i&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gl-epn-programacion-ii.blogspot.com/feeds/5772644034122845735/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2012/11/cifrado-de-vigenere.html#comment-form' title='2 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/5772644034122845735'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/5772644034122845735'/><link rel='alternate' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2012/11/cifrado-de-vigenere.html' title='Cifrado de Vigenère en Java'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3949108534218115935.post-6214225592626682157</id><published>2012-08-20T00:50:00.000-05:00</published><updated>2017-08-24T01:34:23.455-05:00</updated><title type='text'>Cambiar Versión de JDK en Netbeans</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;b style=&quot;background-color: white; color: #0b5394; font-family: &#39;Trebuchet MS&#39;, Verdana, Arial, sans-serif; font-size: large; line-height: 18.899999618530273px;&quot;&gt;Cambiar Versión por Defecto del JDK en Netbeans 7.2 (Funciona en 8.2 también)&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;b style=&quot;background-color: white; color: #0b5394; font-family: &#39;Trebuchet MS&#39;, Verdana, Arial, sans-serif; font-size: large; line-height: 18.899999618530273px;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;img border=&quot;0&quot; height=&quot;179&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLCjLmT-OBVDYaTA3TYA7qqeRd-EJz68cnSV24d79-2vK-BwtdYUeUCBL7I5hgA3bsx8mc6XFIqPsVuc3YmTWmaTKB1M0PQmmfi70A-L4qPsqSpD1N55mdE8dzzV2e2cJBcXgKPKDlL0E/s200/netbeans01.png&quot; width=&quot;200&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
Para los proyectos de desarrollo en Java normalmente utilizo los IDE&#39;s Netbeans o Eclipse de acuerdo a los requerimientos y facilidades que tiene cada uno para determinados escenarios, y recientemente decidí actualizar las versiones de estos, al hacer esto surgió un pequeño inconveniente en Netbeans, el directorio del JDK por defecto que era utilizado por Netbeans era inválido.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
Escenario Inicial:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Netbeans 7.0 para 64 bits&lt;/li&gt;
&lt;li&gt;JDK 1.6 Update 25 para 64 bits&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;Procedo a actualizar primero la versión de Netbeans a la última publicada (&lt;/span&gt;&lt;a href=&quot;http://netbeans.org/downloads/index.html&quot; style=&quot;text-align: justify;&quot;&gt;Netbeans 7.2&lt;/a&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;), al terminar la instalación reviso el estado de los proyectos y todos funcionaban normalmente, luego actualizo el JDK, igual a la última versión disponible (&lt;/span&gt;&lt;a href=&quot;http://www.oracle.com/technetwork/java/javase/downloads/index.html&quot; style=&quot;text-align: justify;&quot;&gt;Java Platform (JDK) 7u6&lt;/a&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;), al terminar la instalación intento abrir el IDE Netbeans 7.2 para revisar los proyectos nuevamente, y la sorpresa fue que se mostró un mensaje como el de la imagen adjunta a continuación:&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkuubIPPGAPeJvyDcojAb5uiOqPPtZLd29aoXcnSPf5WOWBlBrG_-fNIS6P6Fk_aa4XuCaTOFKBWWtCJPeXE8thDhwVadGR9c01t5VzWvqND0_wh8_qr_0Mn4fYIKIJuAnx1rnytCqU9A/s1600/jdk_invalid_home_dir_netbeans.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;148&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkuubIPPGAPeJvyDcojAb5uiOqPPtZLd29aoXcnSPf5WOWBlBrG_-fNIS6P6Fk_aa4XuCaTOFKBWWtCJPeXE8thDhwVadGR9c01t5VzWvqND0_wh8_qr_0Mn4fYIKIJuAnx1rnytCqU9A/s320/jdk_invalid_home_dir_netbeans.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
[Directorio Home del JDK Inválido - Netbeans 7.2]&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
El problema era que como se actualizó primero el Netbeans al momento de su instalación, el IDE reconoció al directorio del JDK antiguo como la versión por defecto a utilizar y como esta fue luego eliminada del equipo es por eso que se mostraba este mensaje, y qué hacemos para solucionarlo?, pues se debe modificar manualmente el archivo de configuración donde esta alojada la ruta del JDK que Netbeans intentará utilizar.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
Pasos para solucionar el problema:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
1) Buscar el directorio de instalación de Netbeans 7.2, por defecto suele ser:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&quot;C:\Program Files\NetBeans 7.2&quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; --&amp;gt; &amp;nbsp;64 bits&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&quot;C:\Program Files (x86)\NetBeans 7.2&quot; &amp;nbsp;--&amp;gt; &amp;nbsp;32bits&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
2) En el directorio anterior buscamos la carpeta que guarda las configuraciones del IDE, de nombre &quot;etc&quot;:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&quot;C:\Program Files\NetBeans 7.2\etc&quot;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; --&amp;gt; &amp;nbsp;64 bits&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&quot;C:\Program Files (x86)\NetBeans 7.2\etc&quot;&amp;nbsp;&amp;nbsp;--&amp;gt; &amp;nbsp;32bits&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;text-align: center;&quot;&gt;3) Abrir el archivo &quot;netbeans.conf&quot;, se puede hacerlo con cualquier editor de texto, por ejemplo Notepad.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
4) Buscar y editar en el archivo de configuración la variable de nombre &quot;netbeans_jdkhome&quot;, la cual contiene el directorio que necesita Netbeans para utilizar el JDK, por ejemplo:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;i&gt;Antes de la edición:&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
netbeans_jdkhome=&quot;C:\Program Files\Java\jdk1.6.0_25&quot;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;i&gt;Después de la edición:&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
netbeans_jdkhome=&quot;C:\Program Files\Java\jdk1.7.0_06&quot;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
En Sistemas Operativos superiores a Windows XP, la edición de este archivo se debe hacer con Permisos de Administrador, luego de la edición, guardamos cambios y volvemos a abrir el IDE Netbeans 7.2, y ya no tendremos ningún problema, todo funcionará como antes.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
Esta edición se puede realizar en las las versiones 6.XX, 7.XX y 8.XX que he probado, las versiones anteriores pueden contener algún archivo de configuración similar, o puede que funcione la misma solución de este post.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
Adicionalmente esta modificación nos puede servir para utilizar varias versiones del JDK en un mismo equipo e incluso se puede cambiar de 64 bits a 32 bits, en caso de desear verificar si el cambio fue efectivo podemos dirigirnos en Netbeans al menú Herramientasl/Tools &amp;nbsp;--&amp;gt; Plataformas Java/Java Platforms, donde podremos ver la versión del JDK que Netbeans reconoció para trabajar, por ejemplo:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFy__QMPJIWjzuZXYHmsxrAwbP_uimoGtVqLlewVhF73HOqKUy_5fKbbZzYmUSEgI-_4GDNAxnMPYu7DUHpfChdO773DnQFgx-VXu1gAEC2uLYBf90LaV0De9xt6iyLW3dh_Ynfh64fmQ/s1600/jdk_default_home.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;148&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFy__QMPJIWjzuZXYHmsxrAwbP_uimoGtVqLlewVhF73HOqKUy_5fKbbZzYmUSEgI-_4GDNAxnMPYu7DUHpfChdO773DnQFgx-VXu1gAEC2uLYBf90LaV0De9xt6iyLW3dh_Ynfh64fmQ/s400/jdk_default_home.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
[Plataformas Java - Netbeans]&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gl-epn-programacion-ii.blogspot.com/feeds/6214225592626682157/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2012/08/cambiar-version-de-jdk-en-netbeans.html#comment-form' title='45 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/6214225592626682157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/6214225592626682157'/><link rel='alternate' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2012/08/cambiar-version-de-jdk-en-netbeans.html' title='Cambiar Versión de JDK en Netbeans'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLCjLmT-OBVDYaTA3TYA7qqeRd-EJz68cnSV24d79-2vK-BwtdYUeUCBL7I5hgA3bsx8mc6XFIqPsVuc3YmTWmaTKB1M0PQmmfi70A-L4qPsqSpD1N55mdE8dzzV2e2cJBcXgKPKDlL0E/s72-c/netbeans01.png" height="72" width="72"/><thr:total>45</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3949108534218115935.post-2925961354015245733</id><published>2012-07-14T03:21:00.002-05:00</published><updated>2012-07-14T03:42:12.597-05:00</updated><title type='text'>Cifrado de César en Java</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;div style=&quot;margin: 0px;&quot;&gt;
&lt;div style=&quot;margin: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-size: large;&quot;&gt;&lt;b&gt;Cifrado de César en Java&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-size: large;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;div style=&quot;margin: 0px;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;http://www.cs.trincoll.edu/~crypto/historical/600px-Alberti_cipher_disk.JPG&quot; width=&quot;200&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;div style=&quot;margin: 0px;&quot;&gt;
&lt;div style=&quot;margin: 0px;&quot;&gt;
Regresando de un largo descanso ahora quiero compartirles una serie de programas realizados en Java para ciertos fines, voy a empezar con un poco de criptografía, y en específico el cifrado de César, para los que no han escuchado de este, a continuación un breve resumen:&lt;br /&gt;
&lt;br /&gt;
&quot;&lt;i&gt;En criptografía, el cifrado César, también conocido como cifrado por desplazamiento, código de César o desplazamiento de César, es una de las técnicas de codificación más simples y más usadas. Es un tipo de cifrado por sustitución en el que una letra en el texto original es reemplazada por otra letra que se encuentra un número fijo de posiciones más adelante en el alfabeto. Por ejemplo, con un desplazamiento de 3, la A sería sustituida por la D (situada 3 lugares a la derecha de la A ), la B sería reemplazada por la E, etc. Este método debe su nombre a Julio César, que lo usaba para comunicarse con sus generales.&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;/i&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;i style=&quot;background-color: white;&quot;&gt;El cifrado César muchas veces puede formar parte de sistemas más complejos de codificación, como el cifrado Vigenère, e incluso tiene aplicación en el sistema ROT13. Como todos los cifrados de sustitución alfabética simple, el cifrado César se descifra con facilidad y en la práctica no ofrece mucha seguridad en la comunicación.&quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Si desean profundizar en el arte de la criptografía y la seguridad informática les recomiendo que visiten el siguiente sitio:&lt;br /&gt;
&lt;a href=&quot;http://imagenfis.epn.edu.ec/hackem&quot; style=&quot;background-color: white; text-align: center;&quot;&gt;Hackem Community Website at EPN (Escuela Politécnica Nacional)&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;
El sitio pertenece a la Comunidad de Software Libre y Hackers Éticos de la Facultad de Ingeniería en Sistemas Informáticos y de Computación de la Escuela Politécnica Nacional, la cual es actualmente la sede de OWASP (Open Web Application Security Project) del Capítulo Nacional y del Capítulo Universitario de Ecuador, más información en el enlace superior.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;En esta Comunidad se suelen dar cursos y capacitaciones en áreas como Software Libre, GNU/Linux y Seguridad Informática y Ethical Hacking, incluso personas que residan en Ecuador pueden participar activamente de forma presencial.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Pero bueno, ahora entrando en&amp;nbsp;materia, el cifrado de César es llamado de desplazamiento, porque mueve cada letra un determinado número de espacios en el alfabeto, en la imagen inferior se representa de forma gráfica:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://upload.wikimedia.org/wikipedia/commons/thumb/2/2b/Caesar3.svg/800px-Caesar3.svg.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;134&quot; src=&quot;http://upload.wikimedia.org/wikipedia/commons/thumb/2/2b/Caesar3.svg/800px-Caesar3.svg.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Es decir que si nosotros queremos enviar un mensaje con el texto en claro: &quot;&lt;i&gt;Kathy&lt;/i&gt;&quot; y utilizamos una llave con un valor de 4, el resultado en texto cifrado (En el Idioma Inglés) sería: &quot;&lt;i&gt;Oexlc&lt;/i&gt;&quot; y en Español sería &quot;Ñexlc&quot;.&lt;br /&gt;
&lt;br /&gt;
Con el ejemplo anterior podemos ver que solo desplazamos 4 letras a todos los caracteres presentes en la palabra, pudiendo ser aplicado a frases completas también; para tener una referencia, este estas son las equivalencias para una llave con valor de 6 para el Idioma Español:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #f9f9f9; border: 1px dashed rgb(47, 111, 171); font-family: monospace, Courier; font-size: 13px; line-height: 1.3em; padding: 1em; text-align: -webkit-auto;&quot;&gt;Texto original:   ABCDEFGHIJKLMNÑOPQRSTUVWXYZ
Texto codificado: GHIJKLMNÑOPQRSTUVWXYZABCDEF&lt;/pre&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;La codificación también se puede representar usando aritmética modular, transformando las letras en números, de acuerdo al esquema A = 0, B = 1,..., Z = 26. La codificación de la letra x con un desplazamiento n puede ser descrita matemáticamente como:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;img alt=&quot;E_n(x) = x + n \mod {27}.&quot; src=&quot;http://upload.wikimedia.org/wikipedia/es/math/0/0/7/0076acbbf147da1c66fafe315175c5b1.png&quot; /&gt;
&lt;/div&gt;
&lt;br /&gt;
Y la decodificación se hace de manera similar:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;img alt=&quot;D_n(x) = x - n \mod {27}.&quot; src=&quot;http://upload.wikimedia.org/wikipedia/es/math/a/4/e/a4e091b53ffd4bcaef75598597fff832.png&quot; /&gt;
&lt;/div&gt;
&lt;br /&gt;
La operación de sustitución se conserva siempre a lo largo de todo el mensaje, por lo que el cifrado se clasifica como un cifrado de tipo sustitución monoalfabética, en oposición a la sustitución polialfabética.&lt;br /&gt;
&lt;br /&gt;
El programa que esta vez les comparto es uno sencillo (próximamente uno mejor) donde solo realizamos la función de descifrado a una cadena que podemos mandar en el Main, por lo tanto el código más importante de esta sería:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; public String decrypt(int c)&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; {&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int posicion = c + desplazamiento;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(posicion &amp;gt; array.length - 1)&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/b&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/b&gt;&amp;nbsp;&lt;b style=&quot;background-color: white;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;b style=&quot;background-color: white;&quot;&gt;posicion = posicion - array.length;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String decod = String.valueOf(array[posicion]);&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return decod;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; }&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Pero ustedes pueden hacer su propia implementación mejorada utilizando algunas entradas explicadas anteriormente, por ejemplo el programa podría leer archivos planos (&lt;a href=&quot;http://gl-epn-programacion-ii.blogspot.com/2011/03/lectura-de-un-archivo-en-java.html&quot;&gt;Lectura de Archivos en Java&lt;/a&gt;), podría leer los datos desde teclado (&lt;a href=&quot;http://gl-epn-programacion-ii.blogspot.com/2010/11/lectura-de-datos-por-consola-scanner.html&quot;&gt;Scanner&lt;/a&gt;&amp;nbsp;&amp;amp; &lt;a href=&quot;http://gl-epn-programacion-ii.blogspot.com/2010/11/lectura-de-datos-por-consola.html&quot;&gt;InputStreamReader&lt;/a&gt;), podría ser en una interfaz gráfica con un Formulario, etc.&lt;br /&gt;
&lt;br /&gt;
Otra función que necesitamos es una que recorra la cadena de caracteres (el mensaje) para poderlo descifrar&amp;nbsp;carácter&amp;nbsp;por&amp;nbsp;carácter:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; private void recorrerMensaje()&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; {&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String decod = &quot;&quot;;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for(int i = 0; i &amp;lt;= mensaje.length() - 1; i++)&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; caracter = mensaje.substring(i, i + 1);&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(!caracter.equals(&quot; &quot;))&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int posicion = getPosicionCaracter(caracter);&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; decod = decrypt(posicion);&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; clave += decod;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; clave += &quot; &quot;;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; }&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Eso es lo básico que necesitamos para nuestra implementación, si deseas una copia del código fuente completo para probarlo en tu computador, lo puedes encontrar en la parte inferior del blog, en la Java Box.&lt;br /&gt;
&lt;br /&gt;
La clase se llama CaesarCipher.java, ustedes deberán crear una clase Main donde creamos la instancia del CaesarCipher y mandamos como parámetro el mensaje cifrado, un ejemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Cipher descifrar = new Cipher();&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;//Desciframos KATHY --&amp;gt; GWPDU&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;System.out.println(&lt;span style=&quot;background-color: white;&quot;&gt;descifrar&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;.descifrarMensaje(&quot;GWPDU&quot;, 4));&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Por cierto en la implementación que se pueden descargar el descifrado utiliza una llave dinámica, para el ejemplo está 4.&lt;/div&gt;
&lt;ul&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gl-epn-programacion-ii.blogspot.com/feeds/2925961354015245733/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2012/07/cifrado-de-cesar-en-java.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/2925961354015245733'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/2925961354015245733'/><link rel='alternate' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2012/07/cifrado-de-cesar-en-java.html' title='Cifrado de César en Java'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3949108534218115935.post-1614835644236649772</id><published>2011-03-04T18:08:00.001-05:00</published><updated>2011-03-04T18:09:24.161-05:00</updated><title type='text'>Escritura de un Archivo en Java</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-size: large;&quot;&gt;&lt;b&gt;Escritura de un Archivo de Texto en Java&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;http://www.openclipart.org/image/800px/svg_to_png/text-file-icon.png&quot; style=&quot;cursor: move;&quot; width=&quot;200&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;Tal y cómo expliqué en la &lt;a href=&quot;http://gl-epn-programacion-ii.blogspot.com/2011/03/lectura-de-un-archivo-en-java.html&quot;&gt;entrada anterior&lt;/a&gt;,&amp;nbsp;existen diversas clases y métodos para leer y escribir los datos en un fichero de texto, pero para facilitar las cosas, hoy veremos como utilizar la clase &quot;&lt;i&gt;File Writer&lt;/i&gt;&quot;, la cual nos permitirá escribir nuestros datos e información en los archivos, esta clase puede recibir 1 o 2 parámetros dependiendo de lo que necesites, el primer parámetro siempre será el nombre del Archivo en donde grabaremos la información y el segundo parámetro que es opcional, es una valor boolean que indicará si&amp;nbsp;sobrescribirá&amp;nbsp;al archivo (borrando todo contenido anterior) o solo agregará la información obtenida al final del archivo ya existente. &lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;Esto es útil en el caso de que el programa que realicemos necesite llevar un registro con fechas o una lista de datos que se van agregando conforme pasa el tiempo, como en una lista de clientes de algún negocio. Bueno, ahora para implementar FileWriter necesitamos también de la clase PrintWriter, la cual es solo utilizada como un buffer en donde se almacenará toda la información que se va a escribir en nuestro archivo, y solo una vez que todo se realizó correctamente, la información se graba en el archivo. Ahora procedemos con el ejemplo:&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;//Import que administra entrada y salida de datos&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;import java.io.*;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;//Nuevo FileWriter&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;FileWriter fichero = new FileWriter(&quot;c:/archivo.txt&quot;);&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;//Nuevo PrintWriter&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;PrintWriter pw = new PrintWriter(fichero);&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;//Escribimos en el Archivo lo deseado&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;pw.println(&quot;Hola Mundo desde un Archivo&quot;);&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;//Cerramos el archivo&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;fichero.close();&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;Es aconsejable colocar el código anterior dentro de un try-catch, debido a que en el manejo de archivos existen algunas excepciones tales como:&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Archivo No Encontrado&lt;/li&gt;
&lt;li&gt;Acceso al Archivo Denegado (tanto en lectura y escritura)&lt;/li&gt;
&lt;li&gt;Cadena de Texto no encontrada, y otras más.&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gl-epn-programacion-ii.blogspot.com/feeds/1614835644236649772/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2011/03/escritura-de-un-archivo-en-java.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/1614835644236649772'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/1614835644236649772'/><link rel='alternate' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2011/03/escritura-de-un-archivo-en-java.html' title='Escritura de un Archivo en Java'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3949108534218115935.post-8352545747466848508</id><published>2011-03-04T15:54:00.011-05:00</published><updated>2011-03-04T17:45:21.611-05:00</updated><title type='text'>Lectura de un Archivo en Java</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-size: large;&quot;&gt;&lt;b&gt;Lectura de un Archivo de Texto en Java&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;http://www.openclipart.org/image/800px/svg_to_png/text-file-icon.png&quot; width=&quot;200&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;Existen diversas clases y métodos para leer y escribir los datos en un fichero de texto, pero para el día de hoy utilizaremos la clase &quot;&lt;i&gt;File Reader&lt;/i&gt;&quot;, esta clase tiene métodos que nos permiten leer caracteres, pero no las líneas completas, ahora por qué queremos las líneas completas?, bueno puede ser para analizarla y extraer ciertos campos de nuestro interés y trabajar con estos. &lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;Entonces como la clase &lt;i&gt;File Reader &lt;/i&gt;no puede hacer esto, utilizaremos otra clase auxiliar llamada &quot;Buffered Reader&quot;, la cual si contiene los métodos que necesitamos para leer las líneas enteras de un fichero. Para utilizar estas clases necesitamos hacer el siguiente import: &quot;java.io.*&quot;, el cual se encarga de administrador todas las formas de entrada y salida de datos en un programa. Ahora lo que haremos será implementar la clase &lt;i&gt;File Reader&lt;/i&gt;&amp;nbsp;para construir un &lt;i&gt;Buffered Reader&lt;/i&gt;, de la siguiente forma:&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; File arNew = new File (&quot;C:\\archivo.txt&quot;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; FileReader fr = new FileReader (arNew);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; BufferedReader br = new BufferedReader(fr);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; //cad almacenará línea de archivo&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; String cad = br.readLine();&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; //Imprimir cad&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; System.out.println(cad);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gl-epn-programacion-ii.blogspot.com/feeds/8352545747466848508/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2011/03/lectura-de-un-archivo-en-java.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/8352545747466848508'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/8352545747466848508'/><link rel='alternate' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2011/03/lectura-de-un-archivo-en-java.html' title='Lectura de un Archivo en Java'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3949108534218115935.post-2184200514199835432</id><published>2011-01-02T05:07:00.003-05:00</published><updated>2011-03-04T16:16:13.401-05:00</updated><title type='text'>Modificadores de Acceso</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: inherit; font-size: large;&quot;&gt;&lt;b&gt;Modificadores de Acceso en Java&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;http://icons.iconarchive.com/icons/babasse/imod/256/private-icon.png&quot; width=&quot;200&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Los modificadores son elementos del lenguaje que se colocan delante de la definición de variables locales, datos miembro, métodos o clases y que alteran o condicionan el significado del elemento. En entradas anteriores se ha descrito uno, el modificador &lt;i&gt;static&lt;/i&gt; que se usa para definir datos miembros o métodos como pertenecientes a una clase, en lugar de pertenecer a una instancia. En entradas futuras se describirán otros modificadores como &lt;i&gt;final,&lt;/i&gt; &lt;i&gt;abstract&lt;/i&gt; o &lt;i&gt;synchronized&lt;/i&gt;. En este capítulo se presentan los modificadores de acceso, que son aquellos que permiten limitar o generalizar el acceso a los componentes de una clase o a la clase en si misma.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Los modificadores de acceso permiten al diseñador de una clase determinar quien accede a los datos y métodos miembros de una clase, estos preceden&amp;nbsp;preceden a la declaración de un elemento de la clase (ya sea dato o método), de la siguiente forma:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;[modificadores] tipo_variable nombre; &amp;lt;--&amp;gt;&amp;nbsp;public int numero;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Existen los siguientes modificadores de acceso:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;public - Todo el mundo puede acceder al elemento. Si es un dato miembro, todo el mundo puede ver el elemento, es decir, usarlo y asignarlo. Si es un método todo el mundo puede invocarlo.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;private - Sólo se puede acceder al elemento desde métodos de la clase, o sólo puede invocarse el método desde otro método de la clase.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;protected - Se explicará en el capítulo dedicado a la herencia.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Sin modificador - Se puede acceder al elemento desde cualquier clase del package donde se define la clase.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Pueden utilizarse estos modificadores para cualquier tipo de miembros de la clase, incluidos los constructores (con lo que se puede limitar quien puede crear instancias de la clase).&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;En el ejemplo los datos miembros de la clase Punto se declaran como private, y se incluyen métodos que devuelven las coordenadas del punto. De esta forma el diseñador de la clase controla el contenido de los datos que representan la clase e independiza la implementación de la interface.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;class Punto&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;{&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;private int x , y ;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;static private int numPuntos = 0;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Punto ( int a , int b )&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;{&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;x = a ; y = b;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;numPuntos ++ ;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;}&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;int getX()&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;{&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;return x;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;}&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;int getY()&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;{&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;return y;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;}&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;static int cuantosPuntos()&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;{&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;return numPuntos;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;}&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;}&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Si alguien, desde una clase externa a Punto, intenta:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Punto p = new Punto(0,0);&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;p.x = 5;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Lo que obtendrá será un error del compilador.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;Usando Modificadores de Acceso en Clases:&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;public - Todo el mundo puede usar la clase. Se pueden crear instancias de esa clase, siempre y cuando alguno de sus constructores sea accesible.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;sin modificador - La clase puede ser usada e instanciada por clases dentro del package donde se define.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;i&gt;Las clases no pueden declararse ni protected , ni private .&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;¿Por qué son importantes los modificadores de acceso?&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Porque estos permiten al diseñador de clases delimitar la frontera entre lo que es accesible para los usuarios de la clase, lo que es estrictamente privado y &#39;no importa&#39; a nadie más que al diseñador de la clase e incluso lo que podría llegar a importar a otros diseñadores de clases que quisieran alterar, completar o especializar el comportamiento de la clase.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Con el uso de estos modificadores se consigue uno de los principios básicos de la Programación Orientada a Objetos, que es la encapsulación: Las clases tienen un comportamiento definido para quienes las usan conformado por los elementos que tienen un acceso público, y una implementación oculta formada por los elementos privados, de la que no tienen que preocuparse los usuarios de la clase.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Los otros dos modificadores, protected y el acceso por defecto (package) complementan a los otros dos. El primero es muy importante cuando se utilizan relaciones de herencia entre las clases y el segundo establece relaciones de &#39;confianza&#39; entre clases afines dentro del mismo package. Así, la pertenencia de las clases a un mismo package es algo más que una clasificación de clases por cuestiones de orden.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Cuando se diseñan clases, es importante pararse a pensar en términos de quien debe tener acceso a que. Qué cosas son parte de la implantación y deberían ocultarse (y en que grado) y que cosas forman parte de la interface y deberían ser públicas.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gl-epn-programacion-ii.blogspot.com/feeds/2184200514199835432/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2011/01/modificadores-de-acceso.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/2184200514199835432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/2184200514199835432'/><link rel='alternate' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2011/01/modificadores-de-acceso.html' title='Modificadores de Acceso'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3949108534218115935.post-8370917660919128608</id><published>2010-11-20T00:52:00.003-05:00</published><updated>2011-03-04T16:16:23.175-05:00</updated><title type='text'>Lectura de Datos por Consola (System)</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-size: large;&quot;&gt;&lt;b&gt;Lectura de Datos por Consola en Java (System)&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;http://andresabad.files.wordpress.com/2007/11/overlord59-tux-paper-1545.png&quot; width=&quot;200&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Para esta ocasión utilizaremos una versión más sencilla que todas las anteriores, y será una función propia del lenguaje Java, así como utilizamos System.out, para imprimir en Pantalla, ahora utilizaremos System.in para ingresar datos en nuestro programa.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Es algo similar a C++ en este caso, para los que recuerden o hayan visto algo de este lenguaje, las sentencias de entrada y salida que utilizaba la librería &lt;i&gt;iostream.h&lt;/i&gt;&amp;nbsp;eran &lt;i&gt;cin&lt;/i&gt; y &lt;i&gt;cout&lt;/i&gt; respectivamente, pero en Java tenemos la ventaja de que no necesitamos de ninguna librería y directamente podremos utilizar ambas propiedades de System (in &amp;amp; out).&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Procedimiento y Uso:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;El System.in.read() leerá los caracteres y los retornará en valores ASCII ya que los vamos a almacenar en una variable entera.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Definimos una variable de tipo int:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;int caracter=0;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Luego colocamos un bucle, el cual debe ser estrictamente finito caso contrario nunca terminaría la operación de lectura., un ejemplo:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;while (caracter!=48)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;El número&amp;nbsp;48 representa en código ASCII al Número 0, esto significa que la lectura de datos terminará cuando el usuario ingrese un Cero y y presione Enter, ahora hacemos que el programa lea los datos así:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;caracter = System.in.read();&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Y listo, esta es la manera más sencilla de una lectura de datos por consola en Java sin usa librerías externas, pero una cosa importante que se debe recordar es controlar en la línea donde está el .read() que siempre haya un Try &amp;amp; Catch para que el Programa no falle en caso de tipos de dato erróneos ingresados.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gl-epn-programacion-ii.blogspot.com/feeds/8370917660919128608/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2010/11/lectura-de-datos-por-consola-system.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/8370917660919128608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/8370917660919128608'/><link rel='alternate' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2010/11/lectura-de-datos-por-consola-system.html' title='Lectura de Datos por Consola (System)'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3949108534218115935.post-8893760735839946189</id><published>2010-11-20T00:21:00.004-05:00</published><updated>2011-03-04T16:16:32.035-05:00</updated><title type='text'>Lectura de Datos por Consola (Scanner)</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-size: large;&quot;&gt;&lt;b&gt;Lectura de Datos por Consola en Java (Scanner)&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://www.sesse.net/tux-paper.png&quot; /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Ésta es otra forma para leer datos en Java, puede ser más fácil de entender que la que utiliza el &lt;i&gt;InputStreamReader&lt;/i&gt; y el &lt;i&gt;BufferedReader&lt;/i&gt;, así que para&amp;nbsp;utilizar el Scanner de java necesitamos primero agregar el siguiente import a nuestro programa:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;import java.util.Scanner;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;También necesitaremos distintas variables, una variable String, una int, y una float en donde almacenaremos el contenido leído:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;String cadena=&quot;&quot;;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;int entero;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;float flotante;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Creación de un Objeto Tipo Scanner:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Scanner leer = new Scanner(System.in);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Ahora dependiendo del tipo de dato a leer colocamos:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;entero = leer.nextInt(); //Lee solo enteros&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;flotante = leer.nextFloat(); //Lee solo flotantes&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;cadena = leer.next(); //Lee Strings&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Algo que hay que tener cuidado es cuando el usuario ingrese un tipo de dato erróneo, es decir si en la variable &lt;i&gt;entero, &lt;/i&gt;le pedimos que ingrese un número entero y este ingresa un caracter, el programa fallaría y se cerraría, o entraría en un bucle infinito; para esa y otras fallas es recomendable utilizar un Try &amp;amp; Catch, aquí la entrada donde detallo el uso de este:&amp;nbsp;&lt;a href=&quot;http://gl-epn-programacion-ii.blogspot.com/2010/03/sentencias-try-catch.html&quot;&gt;Uso de Sentencia Try &amp;amp; Catch&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gl-epn-programacion-ii.blogspot.com/feeds/8893760735839946189/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2010/11/lectura-de-datos-por-consola-scanner.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/8893760735839946189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/8893760735839946189'/><link rel='alternate' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2010/11/lectura-de-datos-por-consola-scanner.html' title='Lectura de Datos por Consola (Scanner)'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3949108534218115935.post-7477623197140283687</id><published>2010-11-19T23:26:00.004-05:00</published><updated>2011-03-04T16:16:44.047-05:00</updated><title type='text'>Lectura de Datos por Consola</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-size: large;&quot;&gt;&lt;b&gt;Lectura de Datos por Consola en Java&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://www.unmundolibre.es/wp-content/plugins/wp-o-matic/cache/71dd0_tux-reading.png&quot; /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Las entradas y salidas (E/S) en Java utilizan streams conocidos como secuencias o flujos.&amp;nbsp;Un flujo representa una corriente de datos con (al menos) un escritor y un lector.&amp;nbsp;Por ejemplo, cuando leemos del teclado estamos usando una corriente de entrada donde el programa es el lector.&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Si deseamos que el usuario ingrese datos (números o cadenas de caracteres) en una consola de Java es necesario utilizar la Clase &lt;i&gt;InputStreamReader&lt;/i&gt;, donde utilizaremos el Objeto System.in, este método solo lee bytes, lo que significa que si ingresamos un caracter cualquiera, nos devolverá un número correspondiente a los bytes del caracter ingresado.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Creación de un Objeto de Tipo InputStreamReader:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;InputStreamReader leer = new InputStreamReader (System.in);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Con el InputStreamReader &lt;b&gt;&lt;i&gt;leer&lt;/i&gt;&lt;/b&gt; que creamos podemos utilizar el método .read() para leer los caracteres, pero aún así no es suficiente puesto que necesitamos de otros &quot;puentes&quot;&amp;nbsp;que conviertan el flujo en modo carácter a uno en modo buffer (un tipo de cadena de caracteres). Para ello contamos con clases como &lt;i&gt;BufferedReader&lt;/i&gt; que recibe en su constructor el flujo de caracteres y maneja el flujo en la forma de buffer, con un método como .readLine() que lee los caracteres hasta encontrar un final de línea (&quot;\n&quot;). Un ejemplo de estas transformaciones (de flujo de byte a flujo de carácter y de éste a buffer) se encuentra en el manejo de teclado.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Creación de un BufferedReader:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;BufferedReader entrada = new BufferedReader(leer);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Y ahora que lo hacemos para leer una línea desde Consola es:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;entrada.readLine();&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Estos caracteres leídos desde Consola pueden almacenarse en un String para luego retornar el valor así:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;String cadena=&quot;&quot;;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;cadena = entrada.readLine();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;return cadena;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;Obviamente para poder usar el return, el código anterior debe estar dentro de un método que devuelva un dato de tipo String, aunque esta forma no es obligatoria si se utiliza en programas cortos&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gl-epn-programacion-ii.blogspot.com/feeds/7477623197140283687/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2010/11/lectura-de-datos-por-consola.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/7477623197140283687'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/7477623197140283687'/><link rel='alternate' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2010/11/lectura-de-datos-por-consola.html' title='Lectura de Datos por Consola'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3949108534218115935.post-8864772491085107517</id><published>2010-10-11T00:27:00.004-05:00</published><updated>2017-10-15T01:59:23.283-05:00</updated><title type='text'>Uso de RadioButtons en Java</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-size: large;&quot;&gt;&lt;b&gt;Utilización de RadioButton&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;img border=&quot;0&quot; height=&quot;196&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdCaS4AIroYRcwfTwlcNNjKzzvRQv-zK6ScVAVySVBgQTVT9K2qEwcBXgnm88KV5yR2zzJpwRZQDdw21lKP-qS1Vtkkys84c_sRpeJOm5npcB7s1yiOJslN56md0ySh7MzCOxwW-0K_SQ/s320/RadioButtonDemo.PNG&quot; width=&quot;320&quot; /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Conocido también como botón de opción o botón de radio es un tipo de widget utilizado en interfaces gráficas de usuario que permite elegir una sola opción de un conjunto predeterminado de estas.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Los botones de opción (botones de radio) se llaman así en referencia a los botones físicos que se usan en los radios para seleccionar estaciones preajustadas - cuando se presionaba uno de los botones, otro de los botones saltaba.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Es posible que, inicialmente, ninguno de los botones de opción en un grupo esté seleccionado. Este estado no puede restaurarse interactuando con el widget del botón de opción (pero es posible a través de otros elementos de la interfaz de usuario).&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Un aspecto interesante de los botones de opción, cuando se utilizan en un formulario HTML, es que si no se marca ningún botón en un grupo, entonces no se pasa ningún par nombre-valor cuando se envía el formulario. Por ejemplo, para un grupo de botones de opción llamado Sexo, con las opciones de Masculino y Femenino, la variable Sexo no pasaría, ni siquiera con un valor en blanco.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Este es un ejemplo común de un RadioButton en donde sólo se permitirá seleccionar un elemento de la lista definida previamente por el Programador:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;img border=&quot;0&quot; src=&quot;https://upload.wikimedia.org/wikipedia/commons/c/cb/Radio_button.png&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Bueno, ahora vamos al código, veamos que se debe hacer para crear uno de estos.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Imports Utilizados:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;import javax.swing.ButtonGroup;&lt;br /&gt;
import javax.swing.JRadioButton;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Definir un RadioButton:&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;JRadioButton rbtn1=new JRadioButton(&quot;txt1&quot;,true);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;JRadioButton rbtn2=new JRadioButton(&quot;txt2&quot;,false);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;JRadioButton rbtn3=new JRadioButton(&quot;txt3&quot;,false);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Creación del Grupo de Botones:&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;ButtonGroup grupo1 = new ButtonGroup();&lt;br /&gt;
grupo1.add(rbtn1);&lt;br /&gt;
grupo1.add(rbtn2);&lt;br /&gt;
grupo1.add(&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;rbtn&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;3);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
La Clase que se utiliza se llama JRadioButton y donde la clase que nos permite crear un grupo donde &quot;almacenaremos&quot; nuestro botones es la ButtonGroup. Los parámetros que se pasan al momento de crearlo son el Texto que llevará y si estará seleccionado este ítem al momento de ejecutar nuestro programa.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Existen otras formas tanto de colocar el texto en un RadioButton como de configurar si este estará seleccionado por defecto, tales como:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;rbtn1.setText(&quot;Texto&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;rbtn1.setSelected(true);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
En el caso de necesitar una validación podríamos hacerlo con un IF:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;if(rbtn1.isSelected()==true)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;System.out.print(&quot;Seleccionó opción 1&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;
&lt;br /&gt;
Ejemplo de Ejecución de un RadioButton en Java:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzPkne9Jyi6KLdt_VLEFDPoFurBIcPSzWWcRJwIioeYAJ98kVS_VPGzCJyrme0nJiG6utayEIibOkMDVPUiv10kmjRea3wWovSQ6zkVt524VjPuIBzYYStfPVBog2GdVpQIKDrmdfPDwg/s1600/RadioButtonDemoMetalAnimals.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;196&quot; data-original-width=&quot;286&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzPkne9Jyi6KLdt_VLEFDPoFurBIcPSzWWcRJwIioeYAJ98kVS_VPGzCJyrme0nJiG6utayEIibOkMDVPUiv10kmjRea3wWovSQ6zkVt524VjPuIBzYYStfPVBog2GdVpQIKDrmdfPDwg/s1600/RadioButtonDemoMetalAnimals.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Nota: Si deseas algún código en especial deja tu petición en algún comentario.&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gl-epn-programacion-ii.blogspot.com/feeds/8864772491085107517/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2010/10/uso-de-radiobuttons-en-java.html#comment-form' title='34 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/8864772491085107517'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/8864772491085107517'/><link rel='alternate' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2010/10/uso-de-radiobuttons-en-java.html' title='Uso de RadioButtons en Java'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdCaS4AIroYRcwfTwlcNNjKzzvRQv-zK6ScVAVySVBgQTVT9K2qEwcBXgnm88KV5yR2zzJpwRZQDdw21lKP-qS1Vtkkys84c_sRpeJOm5npcB7s1yiOJslN56md0ySh7MzCOxwW-0K_SQ/s72-c/RadioButtonDemo.PNG" height="72" width="72"/><thr:total>34</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3949108534218115935.post-5986919332171083668</id><published>2010-09-19T00:05:00.001-05:00</published><updated>2011-03-04T16:17:44.525-05:00</updated><title type='text'>Manejo del Formato de Impresión en Consola</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6; font-size: large;&quot;&gt;&lt;b&gt;Alinear Texto en Java&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Así como en C++, se puede alinear el texto al momento de imprimir una tabla de datos obtenidos, Java tiene la misma función implementada de una manera mucho más simple y sin la necesidad de importar alguna librería extraña, pudiendo controlar la cantidad de espacios que queremos separar entre cada una de las columnas a imprimir, aquí la instrucción:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;System.out.printf(&quot;%10s&amp;nbsp;%10s\n&quot;, &quot;Hilary&quot;, &quot;Standfield&quot;);&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Aquí un ejemplo de como trabaja la misma función pero en C:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;http://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Printf.svg/525px-Printf.svg.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;95&quot; src=&quot;http://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Printf.svg/525px-Printf.svg.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Si deseas descargar un ejemplo de este código funcionando 100% dirígete a la parte inferior del blog, deja algún comentario y Descarga el archivo de mi Java Box, el nombre de archivo para este ejercicio es: &quot;Lista con Formato EPN.java&quot; el cual tiene una lista de estudiantes con Nombre/Apellido, Nota 1, Nota 2, y Promedio, todos alineados correctamente.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;b&gt;Si deseas algún código en especial deja tu petición en algún comentario.&lt;/b&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gl-epn-programacion-ii.blogspot.com/feeds/5986919332171083668/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2010/09/manejo-del-formato-de-impresion-en.html#comment-form' title='71 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/5986919332171083668'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/5986919332171083668'/><link rel='alternate' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2010/09/manejo-del-formato-de-impresion-en.html' title='Manejo del Formato de Impresión en Consola'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>71</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3949108534218115935.post-3016963624584577154</id><published>2010-09-18T16:51:00.001-05:00</published><updated>2011-03-04T16:18:03.531-05:00</updated><title type='text'>Uso del Formateador Decimal</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;Uso de la Clase DecimalFormat&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Muchas veces necesitamos imprimir una variable doble que almacenamos o que obtuvimos por medio de algún cálculo matemático, pero nos vemos con el problema de que nos salen unos 20 decimales, así que para solucionar este problema utilizaremos la Clase Decimal Format, primero veamos algunos conceptos acerca de esta clase:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;DecimalFormat: Es una clase de Java que nos permite mostrar los números en la pantalla (sea en consola o en un JtextFiled) con un formato deseado, es decir, limitar el número de decimales, si usaremos punto o coma, etc, incluso podemos tomar los valores desde un JTextField y reconstruir el número, ahora el ejemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;//import requerido para el Formateador&lt;span style=&quot;color: black;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: darkblue; font-size: 10pt;&quot;&gt;import&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: black; font-size: 10pt;&quot;&gt; java&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: darkred; font-size: 10pt;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: black; font-size: 10pt;&quot;&gt;text&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: darkred; font-size: 10pt;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: black; font-size: 10pt;&quot;&gt;DecimalFormat&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: darkred; font-size: 10pt;&quot;&gt;; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: teal;&quot;&gt;DecimalFormat&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; formateador &lt;/span&gt;=&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;b&gt;DecimalFormat&lt;/b&gt;&lt;/span&gt;(&lt;span style=&quot;color: red;&quot;&gt;&quot;####.####&quot;&lt;/span&gt;);&lt;span style=&quot;color: black;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: brown;&quot;&gt;// Imprime esto con cuatro decimales, es decir: 7,1234&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;System&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;.&lt;span style=&quot;color: black;&quot;&gt;out&lt;/span&gt;.&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;println&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;(&lt;span style=&quot;color: black;&quot;&gt;formateador&lt;/span&gt;.&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;format&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;(7&lt;span style=&quot;color: purple;&quot;&gt;.12342383&lt;/span&gt;));&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
Si utilizamos ceros en lugar de los #, los dígitos no existentes se rellenarán con ceros, un ejemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: teal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;DecimalFormat&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt; formateador &lt;span style=&quot;color: darkred;&quot;&gt;=&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&lt;/b&gt; &lt;b&gt;DecimalFormat&lt;/b&gt;&lt;span style=&quot;color: darkred;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&quot;0000.0000&quot;&lt;/span&gt;&lt;span style=&quot;color: darkred;&quot;&gt;);&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: brown;&quot;&gt;// Imprime con 4 cifras enteras y 4 decimales&lt;/span&gt;&lt;/i&gt;: &lt;i&gt;&lt;span style=&quot;color: brown;&quot;&gt;0001,8200&lt;/span&gt;&lt;/i&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;System&lt;span style=&quot;color: darkred;&quot;&gt;.&lt;/span&gt;out&lt;span style=&quot;color: darkred;&quot;&gt;.&lt;/span&gt;&lt;b&gt;println&lt;/b&gt; &lt;span style=&quot;color: darkred;&quot;&gt;(&lt;/span&gt;formateador&lt;span style=&quot;color: darkred;&quot;&gt;.&lt;/span&gt;&lt;b&gt;format&lt;/b&gt; &lt;span style=&quot;color: darkred;&quot;&gt;(1&lt;/span&gt;&lt;span style=&quot;color: purple;&quot;&gt;.82&lt;/span&gt;&lt;span style=&quot;color: darkred;&quot;&gt;));&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
También podemos utilizar el signo de porcentaje (%) en la máscara y así el número se multiplicará automáticamente por 100 al momento de Imprimir.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: teal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;DecimalFormat&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt; formateador &lt;span style=&quot;color: darkred;&quot;&gt;=&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&lt;/b&gt; &lt;b&gt;DecimalFormat&lt;/b&gt;&lt;span style=&quot;color: darkred;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&quot;###.##%&quot;&lt;/span&gt;&lt;span style=&quot;color: darkred;&quot;&gt;);&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;i&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: brown;&quot;&gt;// Imprime: 68,44%&lt;/span&gt;&lt;/i&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;System&lt;span style=&quot;color: darkred;&quot;&gt;.&lt;/span&gt;out&lt;span style=&quot;color: darkred;&quot;&gt;.&lt;/span&gt;&lt;b&gt;println&lt;/b&gt; &lt;span style=&quot;color: darkred;&quot;&gt;(&lt;/span&gt;formateador&lt;span style=&quot;color: darkred;&quot;&gt;.&lt;/span&gt;&lt;b&gt;format&lt;/b&gt;&lt;span style=&quot;color: darkred;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: purple;&quot;&gt;0.6844&lt;/span&gt;&lt;span style=&quot;color: darkred;&quot;&gt;));&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
La clase DecimalFormat usa por defecto el formato para el lenguaje que tengamos instalado en el ordenador. Es decir, si nuestro sistema operativo está en español, se usará la coma para los decimales y el punto para los separadores de miles. Si estamos en inglés, se usará el punto decimal.&lt;br /&gt;
Una opción para cambiar esto, es utilizar la clase DecimalFormatSymbols, que vendrá rellena con lo del idioma por defecto, y cambiar en ella el símbolo que nos interese. Por ejemplo, si estamos en español y queremos usar el punto decimal en vez de la coma, podemos hacer lo siguiente:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: darkblue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt; java&lt;span style=&quot;color: darkred;&quot;&gt;.&lt;/span&gt;text&lt;span style=&quot;color: darkred;&quot;&gt;.&lt;/span&gt;DecimalFormat&lt;span style=&quot;color: darkred;&quot;&gt;;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: darkblue;&quot;&gt;import&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt; java&lt;span style=&quot;color: darkred;&quot;&gt;.&lt;/span&gt;text&lt;span style=&quot;color: darkred;&quot;&gt;.&lt;/span&gt;DecimalFormatSymbols&lt;span style=&quot;color: darkred;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: teal;&quot;&gt;DecimalFormatSymbols&lt;/span&gt; simbolos &lt;span style=&quot;color: darkred;&quot;&gt;=&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&lt;/b&gt; &lt;b&gt;DecimalFormatSymbols&lt;/b&gt;&lt;span style=&quot;color: darkred;&quot;&gt;();&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;simbolos&lt;span style=&quot;color: darkred;&quot;&gt;.&lt;/span&gt;&lt;b&gt;setDecimalSeparator&lt;/b&gt;&lt;span style=&quot;color: darkred;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;.&#39;&lt;/span&gt;&lt;span style=&quot;color: darkred;&quot;&gt;);&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: teal;&quot;&gt;DecimalFormat&lt;/span&gt; formateador &lt;span style=&quot;color: darkred;&quot;&gt;=&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&lt;/b&gt; &lt;b&gt;DecimalFormat&lt;/b&gt;&lt;span style=&quot;color: darkred;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&quot;####.####&quot;&lt;/span&gt;&lt;span style=&quot;color: darkred;&quot;&gt;,&lt;/span&gt;simbolos&lt;span style=&quot;color: darkred;&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: brown;&quot;&gt;// Imprime: 3.4324&lt;/span&gt;&lt;/i&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;System&lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;out&lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;.&lt;/span&gt;&lt;b style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;println&lt;/b&gt; &lt;span style=&quot;color: darkred; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;formateador&lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;.&lt;/span&gt;&lt;b style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;format&lt;/b&gt; &lt;span style=&quot;color: darkred; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: purple; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;3.43242383&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: darkred; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;));&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: darkred; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;/span&gt;Reconstruyendo un Número:&lt;/div&gt;&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;Supongamos que leemos algún número desde consola o un JTextField y deseamos reconstruirlo con DecimalFormat, se hace de la siguente forma:&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: teal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;JTextField&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt; textField &lt;span style=&quot;color: darkred;&quot;&gt;=&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&lt;/b&gt; &lt;b&gt;JTextField&lt;/b&gt;&lt;span style=&quot;color: darkred;&quot;&gt;();&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;color: teal;&quot;&gt;DecimalFormat&lt;/span&gt; formateador &lt;span style=&quot;color: darkred;&quot;&gt;=&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&lt;/b&gt; &lt;b&gt;DecimalFormat&lt;/b&gt;&lt;span style=&quot;color: darkred;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&quot;####.####&quot;&lt;/span&gt;&lt;span style=&quot;color: darkred;&quot;&gt;);&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;color: teal;&quot;&gt;String&lt;/span&gt; texto &lt;span style=&quot;color: darkred;&quot;&gt;=&lt;/span&gt; textField&lt;span style=&quot;color: darkred;&quot;&gt;.&lt;/span&gt;&lt;b&gt;getText&lt;/b&gt;&lt;span style=&quot;color: darkred;&quot;&gt;();&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;try&lt;/span&gt;&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;{&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: brown;&quot;&gt;// parse() lanza una ParseException en caso de fallo que hay que capturar.&lt;/span&gt;&lt;/i&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: teal;&quot;&gt;Number&lt;/span&gt; numero &lt;span style=&quot;color: darkred;&quot;&gt;=&lt;/span&gt; formateador&lt;span style=&quot;color: darkred;&quot;&gt;.&lt;/span&gt;&lt;b&gt;parse&lt;/b&gt;&lt;span style=&quot;color: darkred;&quot;&gt;(&lt;/span&gt;texto&lt;span style=&quot;color: darkred;&quot;&gt;);&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: darkgreen;&quot;&gt;double&lt;/span&gt; valor &lt;span style=&quot;color: darkred;&quot;&gt;=&lt;/span&gt; numero&lt;span style=&quot;color: darkred;&quot;&gt;.&lt;/span&gt;&lt;b&gt;doubleValue&lt;/b&gt;&lt;span style=&quot;color: darkred;&quot;&gt;();&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;i&gt;&lt;span style=&quot;color: brown;&quot;&gt;// Optimizando las Lineas anteriores:&lt;/span&gt;&lt;/i&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;i&gt;&lt;span style=&quot;color: brown;&quot;&gt;// double valor = formateador.parse(texto).doubleValue();&lt;/span&gt;&lt;/i&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;}&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;catch&lt;/span&gt;&lt;/b&gt; &lt;span style=&quot;color: darkred;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;ParseException&lt;/span&gt; e&lt;span style=&quot;color: darkred;&quot;&gt;)&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;{&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: brown;&quot;&gt;// Error. El usuario ha escrito algo que no se puede convertir a número.&lt;/span&gt;&lt;/i&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gl-epn-programacion-ii.blogspot.com/feeds/3016963624584577154/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2010/09/uso-del-formateador-decimal.html#comment-form' title='6 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/3016963624584577154'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/3016963624584577154'/><link rel='alternate' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2010/09/uso-del-formateador-decimal.html' title='Uso del Formateador Decimal'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3949108534218115935.post-5784486396432403031</id><published>2010-09-15T00:00:00.002-05:00</published><updated>2011-03-04T18:12:06.811-05:00</updated><title type='text'>Descarga JDK - JRE</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6; font-size: x-large;&quot;&gt;JDK &amp;amp; JRE For Java Developers&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://bitelia.com/files/2010/02/Oracle.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;http://bitelia.com/files/2010/02/Oracle.png&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;El JDK (Java Development Kit), es un paquete para los Desarrolladores de Software, que se debe instalar antes de utilizar cualquier IDE (Integrated Development Environment), tales como Eclipe, o NetBeans, así que sin más a continuación el link Oficial de Oracle:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=jdk-6u21-oth-JPR@CDS-CDS_Developer&quot;&gt;Oracle JDK - 6u21&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: auto;&quot;&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;En el link podrán encontrar distribuciones del JDK para distintas platarformas y en distintos lenguajes, por cierto el registro es OPCIONAL, ahora vamos con el JRE (Java Runtime Environment), es un paquete muy similar al JDK, pero a diferencia de este no es utilizado por los desarrolladores, el JRE permite la ejecución del código Java en un Computador, mientras que el JDK contiene utilidades y paquetes extras solo para Programadores, aquí los links:&lt;/div&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=jre-6u21-oth-JPR@CDS-CDS_Developer&quot;&gt;Oracle JRE - 6u21&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.java.com/es/download/&quot;&gt;Java.com --&amp;gt; JRE - 6u21&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://gl-epn-programacion-ii.blogspot.com/feeds/5784486396432403031/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2010/09/descarga-jdk-jre.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/5784486396432403031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/5784486396432403031'/><link rel='alternate' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2010/09/descarga-jdk-jre.html' title='Descarga JDK - JRE'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3949108534218115935.post-7578798074769601265</id><published>2010-09-14T23:04:00.001-05:00</published><updated>2011-03-04T18:13:30.096-05:00</updated><title type='text'>Bibliotecas Gráficas de Java</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&lt;b&gt;Bibliotecas Gráficas de Java&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
Swing es una biblioteca gráfica de java que contiene interfaces gráficas para el usuario como son barras de menús, botones desplegables y tablas.Las componentes Swing se identifican porque pertenecen al paquete javax.swing.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Swing existe desde la JDK 1.1 (como un agregado). Antes de la existencia de Swing, las interfaces gráficas con el usuario se realizaban a través de AWT (Abstract Window Toolkit), de quien Swing hereda todo el manejo de eventos.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Estructura básica de una aplicación Swing.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Una aplicación Swing se construye mezclando componentes con las siguientes reglas.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;* Debe existir, al menos, un contenedor de alto nivel (Top-Level Container), que provee el soporte que las componentes Swing necesitan para el pintado y el manejo de eventos.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;* Otras componentes colgando del contenedor de alto nivel (éstas pueden ser contenedores o componentes simples).&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gl-epn-programacion-ii.blogspot.com/feeds/7578798074769601265/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2010/09/bibliotecas-graficas-de-java.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/7578798074769601265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/7578798074769601265'/><link rel='alternate' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2010/09/bibliotecas-graficas-de-java.html' title='Bibliotecas Gráficas de Java'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3949108534218115935.post-4907167832151836537</id><published>2010-09-14T22:59:00.001-05:00</published><updated>2011-03-04T18:13:47.525-05:00</updated><title type='text'>Contenedores en Java</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;Contenedores en Java&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;Container es una clase abstracta derivada de Component, que representa a cualquier componente que pueda contener otros componentes.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Una interface gráfica está construida en base a elementos gráficos básicos, los Componentes. Ejemplos de estos Componentes son los botones, barras de desplazamiento, etiquetas, listas, cajas de selección o campos de texto. Los Componentes permiten al usuario interactuar con la aplicación y proporcionar información desde el programa al usuario sobre el estado del programa.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Los Componentes no se encuentran aislados, sino agrupados dentro de Contenedores. Los Contenedores contienen y organizan la situación de los Componentes; además, los Contenedores son en sí mismos Componentes y como tales pueden ser situados dentro de otros Contenedores. También contienen el código necesario para el control de eventos, cambiar la forma del cursor o modificar el icono de la aplicación.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Los Componentes deben circunscribirse dentro del Contenedor que los contiene. Esto hace que el anidamiento de Componentes en Contenedores crean árboles de elementos, comenzando con un Contenedor en la raíz del árbol y expandiéndolo en sus ramas.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gl-epn-programacion-ii.blogspot.com/feeds/4907167832151836537/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2010/09/contenedores-en-java.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/4907167832151836537'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/4907167832151836537'/><link rel='alternate' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2010/09/contenedores-en-java.html' title='Contenedores en Java'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3949108534218115935.post-2726569989308087787</id><published>2010-06-17T23:58:00.001-05:00</published><updated>2012-10-05T13:35:11.565-05:00</updated><title type='text'>Métodos de Ordenamiento</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6; font-size: x-large;&quot;&gt;Los 3 Métodos de Ordenamiento más populares&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #45818e;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Hoy les comparto los métodos de ordenamiento de datos más populares que hay, unos más eficientes que otros pero todos conocidos, y de una vez les mostraré un poco de C# para que se den cuenta de la similitud con Java, los ejemplos en código están en ambos lenguajes.&lt;br /&gt;
&lt;br /&gt;
1) Bubble Sort (Ordenamiento Burbuja):&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Es el algoritmo&amp;nbsp;de ordenamiento&amp;nbsp;más sencillo de todos, conocido también como método del intercambio directo, el funcionamiento se basa en la revisión de cada elemento de la lista que va a ser ordenada con el elemento siguiente, intercambiando sus posiciones si están en el orden equivocado, para esto se requieren varias revisiones hasta que ya no se necesiten más intercambios, lo que indica que la lista ha sido ordenada.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
El origen del nombre de este algoritmo proviene de la forma con la que suben por la lista los elementos durante los intercambios, tal y como si fueran &quot;burbujas&quot;, el algoritmo fundamental de este método es la simple comparación de elementos siendo así el más fácil de implementar.&lt;br /&gt;
&lt;br /&gt;
Codificación en Java:&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;static&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; OrdenarBurbuja&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; n&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; temp&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; t &lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; n.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006633;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;length&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;for&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; i &lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nu0&quot; style=&quot;color: #cc66cc;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; i &lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; t&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; i&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;++&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;    {&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;for&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; k &lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; t&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;-&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nu0&quot; style=&quot;color: #cc66cc;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; k &lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; i&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; k&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;--&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;         {&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
                &lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;k&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; n&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;k&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;-&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;                {&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
                    temp &lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; n&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;k&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
                    n&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;k&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; n&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;k&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;-&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
                    n&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;k&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;-&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;  temp&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
                &lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; n&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Codificación en C#:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: #0600ff;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;Public&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; OrdenarBurbuja&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: red; font-size: 1em;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; t&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; x.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: blue; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;Length&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;, temp&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: #0600ff;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;for&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; i&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;1 &lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; i&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; t &lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; i&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;++&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
        {&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: #0600ff;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;       &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: #0600ff; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;for&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: red; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; j &lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; t&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;-&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;1 &lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; j &lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; i&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; j&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;--&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;       &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;{&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: #0600ff;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;       &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;       &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: #0600ff; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; x&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;-&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;       &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;       &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;{&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;       &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;       &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;       &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;temp&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; x&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;       &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;       &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;       &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; x&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;-&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;       &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;       &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;       &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;-&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; temp&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;       &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;       &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;       &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-image: none; border: 0px none white; color: black; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 0px; padding: 0px; vertical-align: top;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Ejemplo del ordenamiento de burbuja ordenando una lista de números aleatorios.&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;img src=&quot;http://upload.wikimedia.org/wikipedia/commons/3/37/Bubble_sort_animation.gif&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;
2) Quick Sort (Ordenamiento Rápido):&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
Es el algoritmo&amp;nbsp;de ordenamiento&amp;nbsp;más eficiente de todos, se basa en la técnica de &quot;Divide y Vencerás&quot;, que permite en promedio, ordenar n elementos en un tiempo proporcional a n*log(n).&lt;br /&gt;
Algoritmo Fundamental:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Elegir un elemento de la lista de elementos a ordenar, al que llamaremos pivote.&lt;/li&gt;
&lt;li&gt;Resituar los demás elementos de la lista a cada lado del pivote, de manera que a un lado queden todos los menores que él, y al otro los mayores. Los elementos iguales al pivote pueden ser colocados tanto a su derecha como a su izquierda, dependiendo de la implementación deseada. En este momento, el pivote ocupa exactamente el lugar que le corresponderá en la lista ordenada.&lt;/li&gt;
&lt;li&gt;La lista queda separada en dos sublistas, una formada por los elementos a la izquierda del pivote, y otra por los elementos a su derecha.&lt;/li&gt;
&lt;li&gt;Repetir este proceso de forma recursiva para cada sublista mientras éstas contengan más de un elemento. Una vez terminado este proceso todos los elementos estarán ordenados.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
Codificación en Java:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;void&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; Quicksort&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; vector, &lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; first, &lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; last)&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
     &lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; i&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;first, j&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;last&lt;/span&gt;&lt;span style=&quot;color: #339933; font-size: medium;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;     &lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; pivote&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;vector&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;first &lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;+&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;last&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;/&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; 2&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;     &lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; auxiliar&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
 
     &lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;do&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;     {&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;    &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;     &lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-size: 1em; font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;while&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;vector&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;pivote&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; i&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;++;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;      &lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;    &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;     &lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-size: 1em; font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;while&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;vector&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;pivote&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; j&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;--;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;    &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;     &lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-size: 1em; font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&amp;lt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-size: 1em;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;    &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;     &lt;/span&gt;&lt;span style=&quot;color: #009900; font-size: medium;&quot;&gt;{&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;    &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;    &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;     &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;auxiliar&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;vector&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;    &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;    &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;    &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;vector&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;vector&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;    &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;    &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;     &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;vector&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;auxiliar&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;    &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;    &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;     &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;++;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;    &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;    &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;     &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;--;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;    &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;     &lt;/span&gt;&lt;span style=&quot;color: #009900; font-size: medium;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;     &lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;     &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;while&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&amp;lt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
 
     &lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;first&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;     &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;{&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;    &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;     &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;Quicksort&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;vector,first, j&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-size: 1em;&quot;&gt;&lt;pre class=&quot;de1&quot; style=&quot;background-image: none; border: 0px none white; color: black; font-size: 1em; padding: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;     }&lt;/span&gt;&lt;/pre&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;     &lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;last&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;     {&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;    &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;     &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;Quicksort&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;vector,i, &lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;last&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-size: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-size: 1em;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
Codificación en C#:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: #0600ff;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;void&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; Quicksort&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; v, &lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; prim, &lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; ult&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: #0600ff;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;prim &lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; ult&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;coMULTI&quot; style=&quot;color: teal; font-style: italic;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;/*Selecciona 1 elemento del vector y coloca los menores
   que él a su izq y los mayores a su derech*/&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; p &lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; Pivote&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;v, prim, ult, ult&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
 
  &lt;/span&gt;&lt;span class=&quot;coMULTI&quot; style=&quot;color: teal; font-style: italic;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;/* Repite el proceso para c/u de las particiones&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; color: black; font-family: monospace, sans-serif; font: normal normal normal 1em/1.2em monospace; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;coMULTI&quot; style=&quot;color: teal; font-style: italic;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;     generadas en el paso anterior */&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
  Quicksort&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;v, prim, p &lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;-&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; 1&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
  Quicksort&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;v, p &lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;+&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; 1, ult&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;coMULTI&quot; style=&quot;color: teal; font-style: italic;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;/* Implementación no clásica de la función Pivote. En lugar de
recorrer el vector simultáneamente desde ambos extremos hasta el
cruce de índices, se recorre desde el comienzo hasta el final */&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; Pivote&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; v, &lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; prim, &lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; ult, &lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; piv&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; p &lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; v&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;piv&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; j &lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; prim&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
 
 &lt;/span&gt;&lt;span class=&quot;co1&quot; style=&quot;color: teal; font-style: italic;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;// Mueve el pivote a la última posición del vector&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
 Intercambia&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;v, piv, ult&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
 
 &lt;/span&gt;&lt;span class=&quot;coMULTI&quot; style=&quot;color: teal; font-style: italic;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;/* Recorre el vector moviendo los elementos menores
  o iguales que el pivote al comienzo del mismo */&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: #0600ff;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;for&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; i &lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; prim&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; i &lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; ult&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; i&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;++&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: #0600ff;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;v&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&amp;lt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; p&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
   Intercambia&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;v, i, j&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
   j&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;++;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
 
 &lt;/span&gt;&lt;span class=&quot;co1&quot; style=&quot;color: teal; font-style: italic;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;// Mueve el pivote a la posición que le corresponde&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
 Intercambia&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;v, j, ult&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
 
 &lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: #0600ff;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; j&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: #0600ff;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;void&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; Intercambia&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; v, &lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; a, &lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: #0600ff;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;a &lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;!=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; tmp &lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; v&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
  v&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; v&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
  v&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; tmp&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
Quicksort en acción sobre una lista de números aleatorios. Las líneas horizontales son valores pivote.&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;img src=&quot;http://upload.wikimedia.org/wikipedia/commons/6/6a/Sorting_quicksort_anim.gif&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
3) Heap Sort (Ordenamiento por Montículos):&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
Es un algoritmo de ordenamiento no recursivo, no estable,&amp;nbsp;consiste en almacenar todos los elementos del vector a ordenar en un montículo (heap), y luego extraer el nodo que queda como nodo raíz del montículo (cima) en sucesivas iteraciones obteniendo el conjunto ordenado. Basa su funcionamiento en una propiedad de los montículos, por la cual, la cima contiene siempre el menor elemento (o el mayor, según se haya definido el montículo) de todos los almacenados en él.&lt;br /&gt;
&lt;br /&gt;
Codificación en Java:&lt;br /&gt;
&lt;br /&gt;
public class heap_Sort&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; public static void main(String a[])&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; int i;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;int arr[] = {1,3,4,5,2};&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;Heap Sort&quot;); &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;\n---------------\n&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;\nUnsorted array\n\n&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; for (i = 0; i &amp;lt; arr.length; i++)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.print(&quot; &quot;+arr[i]);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; for(i=arr.length; i&amp;gt;1; i--)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fnSortHeap(arr, i - 1);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;System.out.println(&quot;Sorted array&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;\n---------------\n&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; for (i = 0; i &amp;lt; arr.length; i++)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.print(&quot; &quot;+arr[i]);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; public void fnSortHeap(int arr[], int arr2)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int i, o;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int lCh, rCh, mCh, root, tmp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; root = (arr2-1)/2;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; for(o = root; o &amp;gt;= 0; o--)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for(i=root;i&amp;gt;=0;i--)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lCh = (2*i)+1;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rCh = (2*i)+2;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if((lCh &amp;lt;= arr2) &amp;amp;&amp;amp; (rCh &amp;lt;= arr2))&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(arr[rCh] &amp;gt;= arr[lCh])&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mCh = rCh;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mCh = lCh;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(rCh &amp;gt; arr2)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mCh = lCh;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mCh = rCh;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(arr[i] &amp;lt; arr[mCh])&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tmp = arr[i];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; arr[i] = arr[mCh];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; arr[mCh] = tmp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; tmp = arr[0];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; arr[0] = arr[arr2];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; arr[arr2] = tmp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Funcionamiento del Heap Sort:&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;img height=&quot;294&quot; src=&quot;http://upload.wikimedia.org/wikipedia/commons/f/fe/Heap_sort_example.gif&quot; width=&quot;320&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gl-epn-programacion-ii.blogspot.com/feeds/2726569989308087787/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2010/06/metodos-de-ordenamiento.html#comment-form' title='2 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/2726569989308087787'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/2726569989308087787'/><link rel='alternate' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2010/06/metodos-de-ordenamiento.html' title='Métodos de Ordenamiento'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3949108534218115935.post-8866333064279878876</id><published>2010-04-29T18:10:00.001-05:00</published><updated>2011-03-04T18:16:29.265-05:00</updated><title type='text'>Sobrecarga de Métodos</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;Sobrecarga de Métodos en Java&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;La Sobrecarga de Métodos en Java (Overloading), es una característica que permite la creación de varios métodos, los cuales tendrán el mismo nombre y serán válidos solamente si cumplen con las siguientes condiciones:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;ol&gt;&lt;li&gt;Tener diferente tipo de dato los parámetros.&lt;/li&gt;
&lt;li&gt;Tener diferente número de parámetros.&lt;/li&gt;
&lt;li&gt;Nunca se considera sobrecarga de métodos si solamente cambia el valor de retorno del método.&lt;/li&gt;
&lt;/ol&gt;Un ejemplo muy simple de recordar es cuando declaramos el constructor, recuerdan que solamente uno podía ir vacío?, mientras que el resto de los constructores que definamos deberán tener de forma obligatoria parámetros, y cumplir con las condiciones anteriormente mencionadas.&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;Ejemplo de Sobrecarga en Constructores:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;public class Automovil&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;//Atributos&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;private String velocidad;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; private String modelo;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; //Constructor Vacío&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;public Automovil()&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;modelo = &quot;Andino&quot;;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;velocidad = &quot;50 Km/h&quot;;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;//Constructor con Parámetros&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; public Automovil(String modelo, String velocidad)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;this.modelo = modelo;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;this.velocidad = velocidad;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}//Fin de Clase Automóvil&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;Ejemplo de Sobrecarga en Métodos de un Programa:&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;public class Numero&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;//Atributos&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;private static int numero1, numero2, numero3; //Atributos que serán los parámetros del método suma&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;private static double numero01, numero02;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;//Metodos&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;public static int suma(int numero1, int numero2)//método suma, 2 parámetros tipo int&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return numero1+numero2;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;public static double suma(double numero1, double numero2)//método suma 2 parámetros tipo double&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return numero1+numero2;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;public static int suma(int numero1, int numero2, int numero3)//método suma 3 parámetros tipo int&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return numero1+numero2+numero3;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}//Fin de Clase Número&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gl-epn-programacion-ii.blogspot.com/feeds/8866333064279878876/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2010/04/sobrecarga-de-metodos.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/8866333064279878876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/8866333064279878876'/><link rel='alternate' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2010/04/sobrecarga-de-metodos.html' title='Sobrecarga de Métodos'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3949108534218115935.post-1334730124017476608</id><published>2010-04-29T17:50:00.001-05:00</published><updated>2011-03-04T18:17:04.324-05:00</updated><title type='text'>Manejo de Caracteres</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;&lt;b&gt;Manejo de Caracteres en Java&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;El manejo de caracteres es un conjunto de métodos y sentencias del Lenguaje Java que nos permite operar(reconocer, transformar, verificar, comparar, etc.) con los caracteres de una cadena de texto, ciertos parámetros que señalamos, de todos, los más comunes e importantes los listo a continuación:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;String toLowerCase();&lt;/b&gt;&lt;br /&gt;
Nos permite transformar todos los caracteres de una cadena en Minúsculas.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;Ejm:&lt;br /&gt;
String sCadena = &quot;CADENA DE PRUEBA GL&quot;;&lt;br /&gt;
System.out.println(sCadena.toLowerCase()); //cadena de prueba gl&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;String toUpperCase();&lt;/b&gt;&lt;br /&gt;
Nos permite transformar todos los caracteres de una cadena en Mayúsculas.&lt;br /&gt;
&lt;br /&gt;
Ejm:&lt;br /&gt;
String sCadena = &quot;Cadena de Prueba GL&quot;;&lt;br /&gt;
System.out.println(sCadena.toUpperCase()); //CADENA DE PRUEBA GL&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;String trim();&lt;/b&gt;&lt;br /&gt;
Método que elimina los espacios en blanco iniciales y finales de la cadena de caracteres, retornando una copia de la misma.&lt;br /&gt;
&lt;br /&gt;
Ejm:&lt;br /&gt;
String sCadena = &quot; Esto Es Una Cadena&quot; ;&lt;br /&gt;
System.out.println(sCadena.trim()); //Devuelve &quot;Esto Es Una Cadena&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;String replace(char oldChar, char newChar)&lt;/b&gt;&lt;br /&gt;
Este método lo utilizamos siempre y cuando deseamos remplazar un carácter por otro. Se reemplazarán todos los caracteres encontrados.&lt;br /&gt;
Una implementación práctica de esto se encuentra en Microsoft Office Word, que nos permite buscar cierto caracter o cadena de caracteres y reemplazarlos automáticamente con otro, incluso lo podemos dejar en blanco.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Sintaxis a seguir:&lt;/b&gt;&lt;br /&gt;
public String replace(char caracter_antiguo, char caracter_nuevo)&lt;br /&gt;
public String replace(CharSequence target, CharSequence replacement)&lt;br /&gt;
&lt;br /&gt;
Ejm:&lt;br /&gt;
String cadena = new String(&quot;Falta de sexo&quot;);&lt;br /&gt;
System.out.println(cadena.replace(&#39;x&#39;,&#39;s&#39;); //Reemplaza todas las &#39;x&#39; por &#39;s&#39; //Por tanto imprime: Falta de seso&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;String valueOf();&lt;/b&gt;&lt;br /&gt;
Este conjunto de métodos de la Clase String nos permite convertir cualquier tipo de dato básico (int, double, float,etc. ) a cadena; en el caso de que tengamos con arrary de caracteres para convertir en una cadena, podemos tener una excepción IndexOutOfBoundsException en el caso de que intentemos acceder a un elemento que no exista. , a continuación los método que nos permite utilizar valueOf :&lt;br /&gt;
&lt;br /&gt;
String valueOf(boolean b);&lt;br /&gt;
String valueOf(int i);&lt;br /&gt;
String valueOf(long l);&lt;br /&gt;
String valueOf(float f);,&lt;br /&gt;
String valueOf(double d);&lt;br /&gt;
String valueOf(Object obj);&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Detalles de los Parámetros para valueOf:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;b, valor booleano a convertir en cadena.&lt;br /&gt;
c, caracter a convertir en cadena.&lt;br /&gt;
i, numero entero a convertir en cadena.&lt;br /&gt;
l, long a convertir en cadena.&lt;br /&gt;
f, decimal a convertir en cadena.&lt;br /&gt;
d, double a convertir en cadena.&lt;br /&gt;
data, array a convertir en cadena.&lt;br /&gt;
offset, desplazamiento a partir va a empezar la conversión.&lt;br /&gt;
count, número de caracteres a convertir de la cadena.&lt;br /&gt;
obj, objeto a convertir en cadena.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Excepción para ValueOf:&lt;/b&gt;&lt;br /&gt;
Indica que el índice pasado como parámetro está fuera de rango (que no existe). Esto aplica a elementos como Array, Vector, String, etc.&lt;/div&gt;&lt;div&gt;&lt;b&gt;Sintaxis a seguir:&lt;/b&gt;&lt;br /&gt;
public IndexOutOfBoundsException()&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Constructores:&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;IndexOutOfBoundsException()&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;IndexOutOfBoundsException(String s)&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;Ejm:&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;String cadena = new String(&quot;Mi cadena&quot;);//Aquí solo hay 9 elementos&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;char caracter = ;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;try{&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;caracter = cadena.charAt(&#39;40&#39;);//Al tratar de acceder al elemento 40 de nuestra cadena, nos da error ya que no existe.&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;} catch (IndexOutOfBoundsException ioobe){&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;System.out.println(&quot;No existe un carácter en esa posición&quot;);&lt;br /&gt;
}&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gl-epn-programacion-ii.blogspot.com/feeds/1334730124017476608/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2010/04/manejo-de-caracteres.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/1334730124017476608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/1334730124017476608'/><link rel='alternate' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2010/04/manejo-de-caracteres.html' title='Manejo de Caracteres'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3949108534218115935.post-4681688326641750226</id><published>2010-04-13T01:08:00.000-05:00</published><updated>2010-04-13T01:12:45.527-05:00</updated><title type='text'>Qué es un Paquete en Java?</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;Java Package&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Package: &amp;nbsp;Como hemos visto para todo proyecto en Java tenemos que crear un paquete, pero qué es realidad este paquete?, para qué sirve?, y físicamente en el computador dónde se nos genera?&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Bueno técnicamente un paquete es un espacio de nombres &quot;namespace&quot; que organiza un conjunto de clases e interfaces relacionadas. Físicamente en el equipo se crean carpetas y estos son los paquetes con los que trabajamos en Java.&amp;nbsp;Como el software escrito en el lenguaje de programación Java puede estar compuesta de cientos o&amp;nbsp;&lt;i&gt;miles&amp;nbsp;&lt;/i&gt;de clases individuales, tiene sentido mantener las cosas organizadas, colocando relacionados clases e interfaces en paquetes.&lt;/div&gt;&lt;br /&gt;
Creación de un Nuevo Paquete en NetBeans:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 1em; margin-right: 1em; margin-top: 0px;&quot;&gt;&lt;img height=&quot;281&quot; src=&quot;http://www.javadabbadoo.org/cursos/infosintesis.net/javase/paqholamundo/netbeans/images/netbeansNuevoPaquete-a.png&quot; width=&quot;400&quot; /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gl-epn-programacion-ii.blogspot.com/feeds/4681688326641750226/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2010/04/que-es-un-paquete-en-java.html#comment-form' title='1 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/4681688326641750226'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3949108534218115935/posts/default/4681688326641750226'/><link rel='alternate' type='text/html' href='http://gl-epn-programacion-ii.blogspot.com/2010/04/que-es-un-paquete-en-java.html' title='Qué es un Paquete en Java?'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>