Print Numbers

You can also use the println() method to print numbers.

However, unlike text, we don't put numbers inside double quotes:

Example

System.out.println(3);
System.out.println(358);
System.out.println(50000);

You can also perform mathematical calculations inside the println() method:

Example

System.out.println(3 + 3);

Example

System.out.println(2 * 5);

 


Login
ADS CODE