Joined: 20 Jan 2008 Posts: 319 Location: Asturias_ España
Posted: Fri 01 Mar 2013, 18:50 Post subject:
Programar en java en Puppy
Para comprobar que funciona podemos escrir el siguiente programa:
import javax.swing.JOptionPane;
public class suma{
public static void main(String args[])
{
int x;
int y;
String temp = JOptionPane.showInputDialog(null, "Introduzca el primer numero");
x = Integer.parseInt(temp);
temp = JOptionPane.showInputDialog(null, "Introduzca el segundo numero");
y = Integer.parseInt(temp);
int z = x + y;
JOptionPane.showMessageDialog(null, "La suma entre "+x+" y "+y+" es "+z);
}
}
Lo pegamos en un compilador de texto lo guardamos com “suma.java” y lo compilamos
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum