Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8562373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:42:58+00:00 2026-06-11T16:42:58+00:00

I noticed that there are more than a few ways of creating user input

  • 0

I noticed that there are more than a few ways of creating user input in a command line program.

I simply don’t know which to choose.

First I was thinking of using an input scanner but then I’m just following the pseudocode of program which includes import java.io.*; tag and nothing more.

Which input method should I use from import java.io.*; which gives me the ability to not only read String but also double and char values without much trouble?

I was googling ways of doing the input but each site uses a different method, which would you recommend?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T16:43:00+00:00Added an answer on June 11, 2026 at 4:43 pm

    I would generally recommend using a Scanner just because it makes everything so easy. If you want to use something from java.io, you could use a BufferedReader in conjunction with an InputStreamReader. Something like this:

    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    System.out.print("Enter anything: ");
    String s = in.readLine();
    System.out.println("You entered: " + s);
    in.close();
    

    Well you get the point. You might have to do some parsing to obtain integers / doubles (using Integer.parseInt(someString) / Double.parseDouble(someString)) from the user’s input.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I've noticed that there seem to be two ways to get the same
I noticed that there are two sets of Hadoop configuration parameters: one with mapred.*
I noticed that there's a whole bunch of different content types, some of them
I have noticed that there are strange requests to my website trying to find
I was following a tutorial and i noticed that there was a linearlayout that
In Firebug (with the FirePHP plugin) I noticed that there is no communication with
I am implementing the superfish menu and have noticed that there is a funny
I've just started to play with CodeIgniter 1.7.2 and imendialtly noticed that there is
After tracing the DB activity from a DNN 5.2.3 site I noticed that there
As a young professional in .Net, I noticed that there are plenty of .Net

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.