Question: how system.out.println works in java?
Answer: System: It is a final class defined in the java. ... println(): As all instances of PrintStream class have a public method println(), hence 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.