File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes is it possible to print without using System.out.println() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "is it possible to print without using System.out.println()" Watch "is it possible to print without using System.out.println()" New topic
Author

is it possible to print without using System.out.println()

kotha vijaybabu
Ranch Hand

Joined: Jan 28, 2006
Posts: 77
hi ranchers
i have a doubt regarding can we print something on the screen
without using System.out.println();

thanx for replies

vijay
[ May 02, 2006: Message edited by: kotha vijaybabu ]
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
How about System.out.print or System.err.println?

Please define your content. What exactly do you mean by "print something on the screen"? Why are you asking this question? What problem are you trying to solve?


There is no emoticon for what I am feeling!
kotha vijaybabu
Ranch Hand

Joined: Jan 28, 2006
Posts: 77
hi Jeff,
i mean to ask that is there anotherway to print something without using
System.out.println()
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
It depends. Why are you asking this question? What problem are you trying to solve?
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18824
    
  40

Originally posted by kotha vijaybabu:
hi Jeff,
i mean to ask that is there anotherway to print something without using
System.out.println()


System.out is merely a static variable holding a print stream to a file output stream to the stdout file descriptor.

I guess you can do something like this...



But why?!?!?

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780

But why?!?!?
[/QB]


We won't know until the original poster tells us why he is asking this question -- What problem is he trying to solve?
Yuriy Zilbergleyt
Ranch Hand

Joined: Dec 13, 2004
Posts: 429
Maybe he just doesn't like typing so many words to print? Sometimes when I'm writing some prototype code and doing a lot of debug printing I do this:

and then just use out.println().
Justin Fox
Ranch Hand

Joined: Jan 24, 2006
Posts: 802
thats bad A yuriy,

ima member that for life lol...

didn't know you could do that..

it really is the small things that make the difference.

-Justin-


You down with OOP? Yeah you know me!
Rusty Shackleford
Ranch Hand

Joined: Jan 03, 2006
Posts: 490
Originally posted by Yuriy Zilbergleyt:
Maybe he just doesn't like typing so many words to print?


That is why the programming gods gave us macros.


"Computer science is no more about computers than astronomy is about telescopes" - Edsger Dijkstra
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38756
    
  23
There is a quicker was to use "out," which only works on J5.0, namely the static import.

You should only use static import for static members you use frequently, and shouldn't import a lot of classes, otherwise you can get confused about where the members come from.

CR
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
Hmmm... we may never know if we answered the original poster's question...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: is it possible to print without using System.out.println()