Hi,
I have been trying to learn java on my own on Linux from command line. Can any one please give me a few very basic samples of code that ask the user for an input (interger/double/float/string all possible data types)? I have downloaded the official Sun Java tutorials but it does not contain many examples of user input from command line. Thanks...
tech291083 5 Junior Poster
Recommended Answers
Jump to PostSystem.out.println("Please provide some input");
That's all you need to do to ask for input.
How you capture that input and what you do with it i'll leave as an exercise to the reader.
Jump to Postand what more would you need than have everything predigested for you like that sample does?
Want someone to put in the exact text you want to show your users for you?
Jump to Postnever used that, grew up with the original APIs and now use commandline arguments and configuration files exclusively as user interfaces :)
All 9 Replies

iamthwee
jwenting 1,905 duckman Team Colleague
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
tech291083 5 Junior Poster
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
jwenting 1,905 duckman Team Colleague
indienick 7 Junior Poster in Training
jwenting 1,905 duckman Team Colleague
indienick 7 Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.