Useful Stuff Necessary to Go Further

Contact Us or call 1-877-932-8228
Useful Stuff Necessary to Go Further

Useful Stuff Necessary to Go Further

System.out.println()

In order to see something happen, we need to be able to print to the screen.

There is a System class that is automatically available when your program runs (everything in it is static).

  • it contains, among other things, input and output streams that match stdin, stdout, and stderr (standard output, standard input, and standard error).

System.out is a static reference to the standard output stream.

As an object, System.out contains a println(String) method that accepts a String object, and prints that text to the screen, ending with a newline (linefeed).

  • There is also a print(String) method that does not place a newline at the end.

You can print a String directly, or you can build one from pieces.

  • It is worth noting that a String will automatically be created from a quote-delimited series of characters.
  • Values can be appended to a String by using the + sign; if one item is a String or quote-delimited series of characters, then the rest can be any other type of data.
Next