What is the meaning of System.out.println(). How it is constructed?

Showing Answers 1 - 7 of 7 Answers

System.out.println(  );

1.The System class contains several useful class fields and methods. It cannot be instantiated.

2.System  class has field out of type PrintStream  class.
3.println()  is a  method in PrintStream class.
public static final PrintStream out
The "standard" output stream. This stream is already open and ready to accept output data. Typically this stream corresponds to display output or another output destination specified by the host environment or user.

For simple stand-alone Java applications, a typical way to write a line of output data is:

     System.out.println(data) 

System is only class which intracts with hardware and out is static reference variable of PrintStream class and println() is a method of PrintStream class.

it's construction is like that...

class Temp
       {
         static Demo d;
                      
              static{
                         d=new Demo();
                       }
       }
class Demo
       {
        void show()
                       {
                         System.out.println("Hello");
                        }
       }
class Demo1
             {
              public static void main(String...s)
                       {
                                 Temp.d.show();
                        }
              }

In which Temp.d.show() is like that System.out.println()

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions