📄 comparison.java
字号:
import javax.swing.JOptionPane;public class Comparison { /** Creates a new instance of Comparison */ public Comparison() { } /** * @param args the command line arguments */ public static void main(String[] args) { String firstnumber, lastnumber; int first, last; firstnumber = JOptionPane.showInputDialog("Enter the first number"); lastnumber = JOptionPane.showInputDialog("Enter the last number"); first = Integer.parseInt(firstnumber); last = Integer.parseInt(lastnumber); if(first == last) JOptionPane.showMessageDialog(null,firstnumber+" == "+lastnumber,"Comparison Result",JOptionPane.PLAIN_MESSAGE); else if (first > last) JOptionPane.showMessageDialog(null,firstnumber+" > "+lastnumber,"Comparison Result",JOptionPane.PLAIN_MESSAGE); else if (first < last) JOptionPane.showMessageDialog(null,firstnumber+" < "+lastnumber,"Comparison Result",JOptionPane.PLAIN_MESSAGE); System.exit(0); } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -