Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / April 2004

Tip: Looking for answers? Try searching our database.

about readLine & println on one line - Help plz

Thread view: 
ssaa - 11 Apr 2004 04:30 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.