我的代码是:
import java.util.Scanner;
class shoham
{
public static void main (String args[])
{
System.out.println("Enter your name: ");
Scanner name = new Scanner(System.in);
System.out.println("Your name is: ");
System.out.print(name.nextLine());
}
}
当我执行这个命令时,我得到如下输出:
Enter your name:
Your name is:
***** (user input)
***** (output)
任何人都可以给出一个给出如下输出的代码:
Enter your name: **** - (user input)
Your name is: **** - (output from user input)`