aspose file tools*
The moose likes Beginning Java and the fly likes Core Java Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Core Java Question" Watch "Core Java Question" New topic
Author

Core Java Question

Sailendra Jena
Greenhorn

Joined: Aug 30, 2010
Posts: 9

Hi,

Can anyone help me how to print a String in console without using System.out.println() in java?


sailendra.n.jena@hotmail.com
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

Sailendra Jena wrote:Hi,

Can anyone help me how to print a String in console without using System.out.println() in java?


Why do you not want to use System.out.println? Is this an interview question or a school test? Are there other constraints?

I would suggest looking at the docs for the System class and the PrintStream class to start with.
Sailendra Jena
Greenhorn

Joined: Aug 30, 2010
Posts: 9

Jeff Verdegan wrote:
Sailendra Jena wrote:Hi,

Can anyone help me how to print a String in console without using System.out.println() in java?


Why do you not want to use System.out.println? Is this an interview question or a school test? Are there other constraints?

I would suggest looking at the docs for the System class and the PrintStream class to start with.



Hi Jeff,

This is an interview question thats why i am asking this question. Whatever you mentioned that is also not correct way to print the String without using System.out.println(). Without using print related method but i want to print any statement. I am not telling you that i am not using this System.out.println(); i am using this but i want to know that is there any other code available which can print the statement without using System.out.println() method.

Thanks & Regards
Sailendra Narayan Jena
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

Personally I think it's a ridiculous question. There is no one right answer, and it has no real-world applicability whatsoever. The interviewer may have thought he was being clever and trying to get you to think outside the box, but this question doesn't really test that at all. And I bet he's looking for one specific answer, and there's no way you could know that without knowing what constraints and assumptions he has in mind.

If answering this question correctly helps somebody get a job, I don't want to read that person's code, or use that company's products.
Mansukhdeep Thind
Ranch Hand

Joined: Jul 27, 2010
Posts: 1157

Jeff Verdegan wrote: If answering this question correctly helps somebody get a job, I don't want to read that person's code, or use that company's products.


Just another example that very Tom, dick and Harry gets to be the interviewer in India's IT industry. Even people who think that they are smart when, in reality , it is quite the opposite. That is one thing I have learned about taking interviews - Never take it for granted that the interviewer will be better than you at what he's supposed to test you for. Many a times they are. But on and off I keep on encountering fools.
Ivan Jozsef Balazs
Rancher

Joined: May 22, 2012
Posts: 877
    
    5
> Without using print related method but i want to print any statement.

I must admit not to quite understand this.

 
 
subject: Core Java Question