Hi,
i am writing a DOS based Java Program. i want to print(my question) and
read a value on same line.
Example:
System.out.println("\nEnter any Number : " );
String Num = st.readLine();
Now, if i run the above code, it will print "Enter any Number : " on one
line and read the value on 2nd line, i mean cursor comes one line below.
So my question is that is there any way to print question and read value
on the same line without bringing cursor one line down?
Thanks for the Help.
Roedy Green - 11 Apr 2004 05:10 GMT
>So my question is that is there any way to print question and read value
>on the same line without bringing cursor one line down?
try System.out.print
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Roger Lindsj=F6 - 12 Apr 2004 22:45 GMT
> So my question is that is there any way to print question and read value
> on the same line without bringing cursor one line down?
Try using System.out.print instead of System.out.println.
//Roger