Print output

description of image


Java Output:


In this chapter, we will learn to print variables and values.

We use,

System.out.println();

To print output to the screen.

The value/variable we want to print is put inside the parentheses ().

Next, we will look at an example of it.



Example: Print Numbers


● copy the below code and paste it your java compiler.



Example: Print Text


● copy the below code and paste it your java compiler.


● To print a text, it must be inside double quotes.



Example: Print sentences


● the code below prints the pie value, which is included in the System.out.println( " " + pie )


● the code below prints the pie value, which is included in the System.out.println( " " + pie )



Quiz


Question Text