Question:

Java <span title="relatedSystem.out.println()">relatedSystem.out.println...</span>

by  |  earlier

0 LIKES UnLike

System.out.println()

above ,how a variable(out) can call the method(println)................

 Tags:

   Report

2 ANSWERS


  1. &quot;out&quot; is not a variable, but a class name and println is a method in the class &quot;out&quot;, System is the namespace.

    to give you and idea, heres a the class structure(as far as my knowledge is concern..heheh)

    namespace System

    {

        class out

       {

         public void println(String str)

         {

              ......

         }

       }

    }

    hope this helps...


  2. System.out refers to a static member of the System class. System.out (along with System.in and System.err) is of type java.io.PrintStream, which has a method (actually, several overloaded methods) called println().

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.