Java Print Variables

Display Variables

The println() method is often used to display variables.

To combine both text and a variable, use the + character:

Example

String name = "John";
System.out.println("Hello " + name);

 

You can also use the + character to add a variable to another variable: Continue reading Java Print Variables