<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MixInformatico.com &#187; Tutorial 2</title>
	<atom:link href="http://www.mixinformatico.com/tag/tutorial-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mixinformatico.com</link>
	<description>Reforzando tus ideas</description>
	<lastBuildDate>Sat, 31 Jul 2010 00:47:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Tutorial Java 2.- Comparaciones, Ciclos, Variables, Conversiones.</title>
		<link>http://www.mixinformatico.com/2010/03/25/tutorial-java-2/</link>
		<comments>http://www.mixinformatico.com/2010/03/25/tutorial-java-2/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 01:06:22 +0000</pubDate>
		<dc:creator>dementexmaster</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Ciclos]]></category>
		<category><![CDATA[Comparaciones]]></category>
		<category><![CDATA[Conversiones.]]></category>
		<category><![CDATA[Tutorial 2]]></category>
		<category><![CDATA[Variables]]></category>

		<guid isPermaLink="false">http://www.mixinformatico.com/?p=8876</guid>
		<description><![CDATA[Bueno en este pequeño tutorial abarcaremos lo que son las comparaciones y los ciclos, empesaremos con las condiciones que esto seria el if, else. antes que nada expicaremos lo que se utilizara, empresaremos con la convercion de una cadena a un entero la cual se hace de la siguiente manera 1 2 String cadena = [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Bueno en este pequeño tutorial abarcaremos lo que son las comparaciones y los ciclos, empesaremos con las condiciones que esto seria el if, else.</p>
<p style="text-align: justify;">antes que nada expicaremos lo que se utilizara, empresaremos con la convercion de una cadena a un entero la cual se hace de la siguiente manera</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #003399;">String</span> cadena <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;4&quot;</span>
<span style="color: #000066; font-weight: bold;">int</span> entero <span style="color: #339933;">=</span> <span style="color: #003399;">Integer</span>.<span style="color: #006633;">parseInt</span><span style="color: #009900;">&#40;</span>cadena<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p style="text-align: justify;">Una ves que vemos como se convierte una cadena a entero veremos como se usan las comparaciones</p>
<p><span id="more-8876"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"> <span style="color: #003399;">String</span> cadena <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;4&quot;</span>
 <span style="color: #000066; font-weight: bold;">int</span> entero <span style="color: #339933;">=</span> <span style="color: #003399;">Integer</span>.<span style="color: #006633;">parseInt</span><span style="color: #009900;">&#40;</span>cadena<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
 <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>entero<span style="color: #339933;">==</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>          <span style="color: #666666; font-style: italic;">//Esto en pseudocodigo seria si lo que ingresaste es igual a 4 entras</span>
    <span style="color: #003399;">JOptionPane</span>.<span style="color: #006633;">showMessageDialog</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">null</span>, <span style="color: #0000ff;">&quot;Estas en lo correcto&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span><span style="color: #000000; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>                          <span style="color: #666666; font-style: italic;">//Si no entonces entras aca.</span>
    <span style="color: #003399;">JOptionPane</span>.<span style="color: #006633;">showMessageDialog</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">null</span>, <span style="color: #0000ff;">&quot;Lo que ingressaste es incorrecto&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p style="text-align: justify;">Ya comprendidos lo que urilizaremos el codigo final seria este:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.swing.*</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Condiciones <span style="color: #009900;">&#123;</span>
&nbsp;
 <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #003399;">String</span> recibido <span style="color: #339933;">=</span> <span style="color: #003399;">JOptionPane</span>.<span style="color: #006633;">showInputDialog</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Cual es la suma de 2 +2 &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #666666; font-style: italic;">//Integer.ParseInt(String)  Este se utiliza para convertir una cadena a entero</span>
  <span style="color: #000066; font-weight: bold;">int</span> minumero <span style="color: #339933;">=</span> <span style="color: #003399;">Integer</span>.<span style="color: #006633;">parseInt</span><span style="color: #009900;">&#40;</span>recibido<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>minumero<span style="color: #339933;">==</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>          <span style="color: #666666; font-style: italic;">//Esto en pseudocodigo seria si lo que ingresaste es igual a 4 entras</span>
    <span style="color: #003399;">JOptionPane</span>.<span style="color: #006633;">showMessageDialog</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">null</span>, <span style="color: #0000ff;">&quot;Estas en lo correcto&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span><span style="color: #000000; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>                          <span style="color: #666666; font-style: italic;">//Si no entonces entras aca.</span>
    <span style="color: #003399;">JOptionPane</span>.<span style="color: #006633;">showMessageDialog</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">null</span>, <span style="color: #0000ff;">&quot;Lo que ingressaste es incorrecto&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Aqui dejo el PDF que menciono en el tutorial:</p>
<p>http://www.inquisidores.net/files/2E-Expresiones.pdf</p>
<p>Aqui les dejo el videotutorial:</p>
<p>[youtube]http://www.youtube.com/watch?v=otJhlWDw8YE[/youtube]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mixinformatico.com/2010/03/25/tutorial-java-2/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.495 seconds -->

