java中用户输入语句的写法是:
1、【Scanner sc = new Scanner(System.in); 】;
2、【String input = sc.next();】。
(视频教程推荐:java视频)
具体代码如下:
import java.util.Scanner; public class Number { /*** @param args* author:sun* time:2011-05-25 12:10*/public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("请输入内容:"); Scanner sc = new Scanner(System.in); String input = sc.next(); System.out.println("你输入的内容为:"+input);}}
推荐教程:java入门程序