One of the most commonly used methods in Java, System.out.println(), prints the given message to the console. It’s incredibly useful for debugging or displaying program output.
Source Code
System.out.println("Hello, World!"); // Prints a string
System.out.println(123); // Prints an integer
Regularly use System.out.println() to output variable values or messages to the console for debugging purposes or to understand how your program’s data changes over time.