Number - if(num<0)...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import javax.swing.JOptionPane; public class Number { public static void main(String[]args) { String number = JOptionPane.showInputDialog(null,"Enter an Integer"); int num; num = Integer.parseInt(number); if(num >=1) JOptionPane.showMessageDialog(null,"The integer is positive");
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: if(num<0) JOptionPane.showMessageDialog(null,"The integer is negative"); if(num == 0) JOptionPane.showMessageDialog(null,"The integer is zero"); System.exit(0); }}...
View Full Document

Ask a homework question - tutors are online