| | |
string input
![]() |
•
•
Join Date: Apr 2007
Posts: 1
Reputation:
Solved Threads: 0
hello we use the class io.*; in our college we use in a unix platform
which is import io*.;
i am trying to code a code so taht i can get a string input i tried ConsoleInput.readString, and also ConsoleInput.readLine()
but still i get an error it says that readString or readLine not found in class io
what can i code
thanks
which is import io*.;
i am trying to code a code so taht i can get a string input i tried ConsoleInput.readString, and also ConsoleInput.readLine()
but still i get an error it says that readString or readLine not found in class io
what can i code
thanks
A small program to get you started:
java Syntax (Toggle Plain Text)
import java.io.*; public class Test { public static void main(String[] args) { try { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String userInput = in.readLine(); System.out.println("\n\nUser entered -> " + userInput); } catch(IOException e) { System.out.println("IOException has been caught"); } } }
I don't accept change; I don't deserve to live.
The same way you're reading the doubles, but without the parsing, of course.
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
![]() |
Similar Threads
- user input into a string (C++)
- Use string input for enum (C++)
- string input segmentation fault on linux (C++)
- Masking a string input (Python)
- string input not working as expected (C++)
Other Threads in the Java Forum
- Previous Thread: parsing a string
- Next Thread: sending files
| Thread Tools | Search this Thread |
2dgraphics account android api apple applet application arguments array arrays automation banking binary binarytree bluetooth chat chatprogramusingobjects class client code color component count database derby design eclipse eclipsedevelopment encryption error fractal game givemetehcodez graphics gridlayout gui homework html ide if_statement image integer interface j2me java javadesktopapplications javaprojects jlabel jni jpanel julia keyword linux list macintosh map method methods midlethttpconnection mobile netbeans newbie nullpointerexception object open-source os problem producer program programming project projectideas property read recursion reference replaysolutions ria scanner search server set size sms sort sourcelabs splash sql sqlite stop string swing testautomation threads transforms tree ui unicode validation windows






