how to input a string variable in java? can anyone help me with this
Do you mean you want to declare a string variable or you want anyone to run your java program and input a string?
i am a begineer and i just want to input a string and run the program
will you please help me out
Try this: `new String myStringName = "Hello there!";`
thank you
input "enter the character =",a where "a" is a string i have done this many times in q basic but how to do this in java
``` InputStreamReader in = new InputStreamReader(System.in); BufferedReader reader = new BufferedReader(in); System.out.println("Enter String: "); String enteredString = null; try { enteredString = reader.readLine(); } catch (IOException e) { e.printStackTrace(); } System.out.println(enteredString); ``` So that's pretty complicated, but it should give you what you want. I can explain anything that you can't figure out by playing with it for a few seconds.
Join our real-time social learning platform and learn together with your friends!