System.out.println() (Java)
System.out.println() prints a line of text to the console and then moves to a new line. It is Java's standard way to display output and is usually the first thing you learn.
Java
Use println() when you want a newline after the text, and print() when you don't. It is the Java equivalent of print() in Python and console.log() in JavaScript.
You can print text, numbers, or variables, and join values with the + operator.
Examples
Java
String name = "Sam";
int age = 20;
System.out.println(name + " is " + age);
System.out.print("no newline");Output:
Sam is 20
no newline