aspose file tools*
The moose likes Beginning Java and the fly likes Value of variable required to be entered by user. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Value of variable required to be entered by user." Watch "Value of variable required to be entered by user." New topic
Author

Value of variable required to be entered by user.

Vishnu Sharma
Ranch Hand

Joined: Feb 03, 2010
Posts: 55
I want in my code a String value, that is entered by the user, which method i can use for it, as we use scanf in C language.


Regards,
Vishnu
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10255
    
    8

Where is the user going to enter? Swing component? Web component? Console?


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Jonas Isberg
Ranch Hand

Joined: Mar 18, 2003
Posts: 118
I am guessing that scanf in C takes input from the console.
One way to do that in java is to use System.in (there might
be more friendly alternatives).
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10255
    
    8

Since 1.5 the ideal way would be the java.util.Scanner class
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Value of variable required to be entered by user.