Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

alternative for system.out.println

 
sarathchandra chandala
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to print a string in Java without using System.out.println ?
 
udhaya kanagaraj
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi sarathchandra chandala,

Do you what to print the string in the console? If that's the console we do not have any other option other than System.out.print

Thanks and Regards,
Udhaya
 
Manuel Leiria
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what you are trying to do but check the java.util.logging.Logger class
 
Sandilya Garimella
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
you can use the System.out.printf method which is similar to the printf in C. This gives you the option for formatting your output onto the screen...
 
Rob Spoor
Sheriff
Pie
Posts: 20669
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
System.console() may return a Console object which you can use to print to stdout as well (since Java 6).
 
Adam J Smith
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could always create a simple method to do all of your console printing but I don't know if that is really a better solution. What is your reason for not using System.out.println?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic