Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How exactly the line is getting printed on "Console" using System.out.print()

Tags:

java

If i want to print a line

This is Java programming language

to the console using System.out.print(), which and how many process gets used to print this line, and how we can compare it with writing the same line to file using FileWriter or BufferedWriter.

like image 996
Deven Patil Avatar asked Nov 03 '22 02:11

Deven Patil


2 Answers

out is a static member of class System having type PrintStream http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/System.html. You can create PrintStream objects for files and use them similarly. http://docs.oracle.com/javase/1.5.0/docs/api/java/io/PrintStream.html

like image 90
uba Avatar answered Nov 14 '22 23:11

uba


Check PrintStream.java file to know the process of print method.

Check here for detailed flow of process

like image 36
NaveenKumar1410 Avatar answered Nov 15 '22 00:11

NaveenKumar1410