Java的输入语句

1、在控制台中输入
        System.out.println("请输入内容:");
        Scanner sc = new Scanner(System.in);
        String input = sc.next();
        System.out.println("你输入的内容为:"+input);

2、在弹出弹框中输入
     String str="";
     str
=javax.swing.JOptionPane.showInputDialog("请输入N的值(输入exit退出):");
     System.out.println(str);

 

 

本文作者:岁月记忆

本文链接:https://www.cnblogs.com/huang2979127746/p/16338116.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   岁月记忆  阅读(4375)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起