要调用Scanner这个类
package jj;
import java.util.Scanner;
public class Tirge{
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in); //创建Scanner对象
System.out.println("请输入字符");
String str= scanner.next(); //接收字符
System.out.println("请输入整数");
int in=scanner.nextInt(); //整型
System.out.println("请输入浮点数");
double f=scanner.nextFloat(); //浮点型
System.out.println("你输入的字符"+str);
System.out.println("你输入的整数"+in);
System.out.println("你输入的浮点数"+f);
}
}