Home

What is System.out.println() in Java ?

Please see the below example carefully to know about System.out.println() .If you able to understand the example then you understand System.out.println() eaisly.

Example

     Class Test
       {
	  Static String s=“java”;
       }
   
  1. As you know here Test is a class.
  2. “s” is a static variable type String.
  3. Here “java” is nothing but the value of “s”.

Now I am going to print the length(How many character) of “s”.

So i am writing.

Test.s.length();

Example

      Class System
        {
	  Static PrintStrem out;
	    .
	    .
	    .
	}
  
  1. As you know here System(present in java.lang package) is a class.
  2. “out” is a static variable type PrintStream.
  3. Here “java” is nothing but the value of “s”.

System.out.println("Hello");

Now see the below example.

Test.s.length();
System.out.println()




©2017 Students Tutorial.