Reading a String from the keyboard


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Reading a String from the keyboard

  1. #1
    Jeanie Guest

    Reading a String from the keyboard


    I am a java beginner, I have to design a program for my java class that entails
    setting up a reservation for a customer. I am to get the user to input their
    name. First, Middle, and Last. It should be stored in an array and the subscript
    is their chosen reservation room. Any help would be greatly appreciated.

  2. #2
    Guest

    Re: Reading a String from the keyboard

    I'm not sure what you have been exposed to, but this will hopefully get you
    started.

    import java.io.*;
    public class sysIn {

    public static void main(String args[]) {
    try {
    BufferedReader in = new BufferedReader(new
    InputStreamReader(System.in));
    System.out.print("Name:");
    String s1 = in.readLine();
    System.out.println(s1);
    }
    catch (IOException io) {}
    }

    }

    "Jeanie" <lunar528@aol.com> wrote in message
    news:3a8df02f$1@news.devx.com...
    >
    > I am a java beginner, I have to design a program for my java class that

    entails
    > setting up a reservation for a customer. I am to get the user to input

    their
    > name. First, Middle, and Last. It should be stored in an array and the

    subscript
    > is their chosen reservation room. Any help would be greatly appreciated.




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center