Explain about System.out.println();

System.out.println();
This is the line we are using from the first day of coding. System is actually a class in the java.lang package. We do not need to import this java.lang.* package, as it is imported by default.
Class System
{
    static PrintStream out;
    .
    .
    .
}
System.out.println("hello");

Conclusion from the above code:

  • System is a class present in java.lang package.
  • out is a static method of PrintStream type.
  • println() is a method present in  java .io.PrintStream class.

No comments:

Post a Comment