在java中打印名称?

时间:2016-11-11 09:56:17

标签: java

你能告诉我如何解决这个问题吗?

扫描仪扫描仪=新扫描仪(System.in);

<!-- NETWORK RECEIVER... -->
<receiver android:name=".utils.NetworkUtils" >
    <intent-filter>
        <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
    </intent-filter>
</receiver>

1 个答案:

答案 0 :(得分:0)

    package Exercise2501;
    import java.util.Scanner;

    public class Friends {

    public static void main(String[] args) {

      Scanner scanner = new Scanner(System.in);
      //Get the number of entries 
      System.out.println("How many names do you want to enter?");
      int number = scanner.nextInt();
      //create an array with that number
      String names[] = new names[number];
      //Ask the user to enter the Names
      System.out.println("Type a few names. ");
      //Store the names in the array
      for (int i = 0; i < number; i++)
      {   
          names[i] = scanner.nextLine();
      }
      //Do the remaining you want
    }

    }