⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 comparison.java

📁 北京邮电大学牛导的 JAVA课件课件及相关资料
💻 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 + -