0

I have no idea how to start writing a java code to print
a string without using any inbuilt function like println etc.

Does anyone know how to write it?

peter.petrov
  • 38,363
  • 16
  • 94
  • 159
user3448119
  • 107
  • 10
  • 4
    what is the motivation behind this requirement? – amit Apr 29 '14 at 22:10
  • You can't do anything very much, in any programming language, without using some kind of "inbuilt function". What exactly is the point of this question? What are you trying to do? – Dawood ibn Kareem Apr 29 '14 at 22:20

2 Answers2

0

I will not paste you all the article you can read here: http://luckytoilet.wordpress.com/2010/05/21/how-system-out-println-really-works/

But read it and look the repetition of "native" word.

Then you can jump to this other post : What is a native implementation in Java?

Then, you will have the presumption that you cannot write to process standard stream (or error) without using any native function, because you need something runnable on different OS... and that's the goal of the JVM.

Community
  • 1
  • 1
farvilain
  • 2,552
  • 2
  • 13
  • 24
-1

You can write it using PrintWriter class

PrintWriter printWriter = new PrintWriter(System.out);
        printWriter.write("Hello");
        printWriter.flush();
        printWriter.close();
Asif Bhutto
  • 3,916
  • 1
  • 24
  • 21