Results 1 to 2 of 2
  1. #1
    sims34 is offline Member
    Join Date
    Jan 2013
    Rep Power

    Default How to print array from user input?

    I'm working on this problem but I can't get the information that the user enters to print in the array, the only thing that prints is "done", I know if probably something simple but I can't figure it out. Here is what i have so far:

    Java Code:
    public static void main(String[] args) {
    String[][] inputData = new String[10][2];
    Scanner input = new Scanner(;
    String word = "";
    System.out.println("Enter your data: ");
    word =;
    System.out.println("Done, BYE!");
    System.out.println("This is the array");
    for(int i = 0; i < inputData.length; i++){
    for(int j = 0; j < inputData[i].length; j++){
    inputData[i][j] = word
    Any help would be greatly appreciated.
    Last edited by sims34; 01-29-2013 at 06:32 AM.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

    Default Re: How to print array from user input?

    Follow the link posted in this response in your last thread:

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. How to store user input into an array
    By codyjava in forum New To Java
    Replies: 11
    Last Post: 12-02-2012, 05:08 AM
  2. Creating 2D array from all user input
    By peek_a_boo in forum New To Java
    Replies: 1
    Last Post: 12-08-2011, 09:16 PM
  3. Print Parts Of An Array [User Input]
    By PrimalScientist in forum New To Java
    Replies: 22
    Last Post: 08-30-2011, 12:09 PM
  4. user input array
    By localhost in forum New To Java
    Replies: 5
    Last Post: 12-30-2010, 05:00 AM
  5. Replies: 2
    Last Post: 12-02-2010, 05:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts