zoukankan      html  css  js  c++  java
  • java的输入输出

     1 import java.util.Scanner;
     2 public class TestScanner {
     3 public static void main(String[] args) {
     4     Scanner scanner = new Scanner(System.in);
     5     System.out.println("请输入名字");
     6     String name=scanner.nextLine();
     7     System.out.println("请输入爱好");
     8     String favor=scanner.nextLine();
     9     System.out.println("请输入年龄");
    10     String age=scanner.nextLine();
    11     System.out.println("###################");
    12     System.out.println("姓名:"+name+"爱好:"+favor+"年龄:"+age);
    13     scanner.close();
    14     
    15     
    16 }
    17 }

    输出如下:

  • 相关阅读:
    Java's Volatile Keyword
    reflection
    Spring
    Stack
    Set
    Vector & ArrayList
    CreateFileDemo
    session原理
    multithreadingDemo
    REST风格
  • 原文地址:https://www.cnblogs.com/wq-9/p/10293320.html
Copyright © 2011-2022 走看看