• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Core Java Question

 
Greenhorn
Posts: 10
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Can anyone help me how to print a String in console without using System.out.println() in java?
 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 10
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 6109
6
Android IntelliJ IDE Java
  • Likes 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 1164
Eclipse IDE Firefox Browser Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Rancher
Posts: 1044
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
> Without using print related method but i want to print any statement.

I must admit not to quite understand this.

 
We can fix it! We just need some baling wire, some WD-40, a bit of duct tape and this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic