Title here
Summary here
Our first program will demonstrate various value types including strings, integers, floats, and booleans. Here’s the full source code.
To run the program, compile the code and then use java
to execute it.
Java has various value types including strings, integers, floats, booleans, etc. This example demonstrates a few basic ones:
+
operator.Note that unlike some languages, Java doesn’t have a built-in println
function. Instead, we use System.out.println()
to print to the console.
Also, in Java, you need to explicitly wrap arithmetic operations in parentheses when including them in a string concatenation, as shown in the 1+1
and 7.0/3.0
examples.