close

import javax.swing.JOptionPane;
public class PrintVAR {
    public static void main(String args[])
    {
        int i ; //宣告變數並設定起始值
        String s ; //儲存使用者輸入的字串
        s = JOptionPane.showInputDialog("輸入一個整數");
        i = Integer.parseInt(s);
        System.out.println(i); //輸出變數值
        System.out.print("i = " +i); //用 + 運算子,串聯字串與變數
    }
}
 

arrow
arrow
    文章標籤
    JAVA JOptionPane ANDROID
    全站熱搜
    創作者介紹
    創作者 陰界黑幫 的頭像
    陰界黑幫

    巨獸 逆襲

    陰界黑幫 發表在 痞客邦 留言(0) 人氣()