1
u/gndn Aug 30 '14
Did you read the docs? It's for writing to the standard output stream. It's mostly used for console based applications, and occasionally for logging purposes.
1
Did you read the docs? It's for writing to the standard output stream. It's mostly used for console based applications, and occasionally for logging purposes.
17
u/Talon876 Extreme Brewer Aug 30 '14
System is a built in class with a static instance of a PrintStream object named
out.Because it's static, you can access it directly from the class,
System.out.The PrintStream object has methods such as
printandprintlnwhich allow you to output text to the console, as you've probably seen.You could create your own 'System' class by doing something like this:
then you could write
MySystem.printer.println("example");and it would act the same way asSystem.out.println.