what is system.out.println in Java?

what is system.out.println in Java?

System.out.println is a Java statement that prints the argument passed into the console which is generally standard output.

In detail:

1)    system is the name of the class in java.lang package.
2)    out is an object of print stream class and declared as static in System class. Present in java.lang package.
3)    println() is a method of the PrintStream class. Present in the java.io package.

Explaning System.out.println using Java Programs:

Class A Program:

class A
 int i,j;
 void funA()
  System.out.println("FunA() of A");

Class Sdemo program:

class Sdemo
 static int i = 1;
 static A a1 = new A();

Class Test program:

class Test
 public static void main(String[] args)

In the above program look at the Sdemo.a1.funA();

1)    Sdemo is the name of the class.
2)    a1 is the object of Class A which is declared as static in Sdemo class.
3)    funA() is a method of A class. Like Sdemo.a1.funA(); System.out.println() is also declared.

Our Services

Search This Blog

  • ()
Powered by Blogger.

C Variables and Types of Variables in C

C variable is a data name that may be used to store a data value. The value of the C variable may get change in the program and it can be r...