DEV Community

Pavithra Saravanan
Pavithra Saravanan

Posted on

1

System.out.println in Java

Java System.out.println() is used to print an argument that is passed to it. [TBD]

Parts of System.out.println()

The statement can be broken into 3 parts which can be understood separately:
System: It is a final class defined in the java.lang package.
out: This is an instance of PrintStream type, which is a public and static member field of the System class.
println(): As all instances of the PrintStream class have a public method println(), we can invoke the same on out as well. This is an upgraded version of print(). It prints any argument passed to it and adds a new line to the output. We can assume that System.out represents the Standard Output Stream.

System and PrintStream package

As we know, Method Overloading in Java allows different methods to have the same name, but different signatures or parameters where each signature can differ by the number of input parameters or type of input parameters or both. From the use of println() we observed that it is a single method of PrintStream class that allows the users to print various types of elements by accepting different type and number of parameters.

For example:

System.out.println(),
System.out.println(int),
System.out.println(double),
System.out.println(string),
System.out.println(character),
etc.

Reference link:https://www.geeksforgeeks.org/system-out-println-in-java/

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

While many AI coding tools operate as simple command-response systems, Qodo Gen 1.0 represents the next generation: autonomous, multi-step problem-solving agents that work alongside you.

Read full post

Top comments (1)

Collapse
 
payilagam_135383b867ea296 profile image
Payilagam

Good One! Please explain tomorrow.

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay