<?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 1</title>
	<atom:link href="http://www.mixinformatico.com/tag/tutorial-1/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 1.- Introduccion a java</title>
		<link>http://www.mixinformatico.com/2010/03/24/tutorial-java-1-introduccion-a-java/</link>
		<comments>http://www.mixinformatico.com/2010/03/24/tutorial-java-1-introduccion-a-java/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 07:02:53 +0000</pubDate>
		<dc:creator>dementexmaster</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Introducción a java]]></category>
		<category><![CDATA[Tutorial 1]]></category>

		<guid isPermaLink="false">http://www.mixinformatico.com/?p=8832</guid>
		<description><![CDATA[Sin duda alguna el ejercicio más simple, y a la par, el que nunca puede faltar en cualquier lenguaje de programación es el programa Hola Mundo. Este consiste en sacar por pantalla la archiconocida frase de “Hola Mundo”. Lo primero que tendremos que hacer es crear la estructura base de nuestro codigo que seria algo [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Sin duda alguna el ejercicio más simple,  y a la par, el que nunca  puede faltar en cualquier lenguaje de  programación es el programa Hola  Mundo. Este consiste en sacar por pantalla la  archiconocida frase de  “Hola Mundo”.</p>
<p style="text-align: justify;">Lo primero que tendremos que hacer es crear la estructura base de nuestro codigo que seria algo asi.</p>
<p style="text-align: justify;">

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> HolaMundo <span style="color: #009900;">&#123;</span>
  <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>
       <span style="color: #666666; font-style: italic;">//Aqui se coloca el codigo a ejecutar</span>
    <span style="color: #009900;">&#125;</span>
 <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><span id="more-8832"></span><br />
Solo nos quedará mostrar el texto &#8220;Hola Mundo&#8221; por la consola. Para  ello utilizaremos la clase estática System.out. Esta clase nos permite  acceder a la salida de la consola. En concreto usaremos el método  println(texto).</p>
<p>Finalmente el código nos quedará de la siguiente forma:</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: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> HolaMundo <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;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Hola Mundo&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>Para compilar y ejecutar este código tendremos que ejecutar las  siguientes sentencias:</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;">javac HolaMundo.<span style="color: #006633;">java</span>
java HolaMundo</pre></td></tr></table></div>

<p>Se puede hacer los mismo con ventanas usando la libreria swing utilizaremos el complemento JOptionPane:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</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> HolaMundo <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>
 <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;Hola Mundo&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>Con este complemento de la libreria swing, tambien se pueden recibir parametros con el InputDialog el cual quedaria de esta forma:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</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> HolaMundo <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 tu edad&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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;Tu edad es &quot;</span><span style="color: #339933;">+</span>recibido<span style="color: #339933;">+</span><span style="color: #0000ff;">&quot; años&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
 <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Aqui esta el tutorial en youtube:</p>
<p>[youtube]http://www.youtube.com/watch?v=neZW8ygyLeI[/youtube]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mixinformatico.com/2010/03/24/tutorial-java-1-introduccion-a-java/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

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

