Java has various value types including Strings,
Integers, Floats, Booleans, etc. Here are a few
basic examples.
|
|
|
public class CoreValueTypes {
|
|
public static void main(String[] args) {
|
Strings, which can be added together with + .
|
System.out.println("Java" + "Program");
|
Integers and floats.
|
System.out.println("1+1 =", 1+1);
System.out.println("7.0/3.0 =", 7.0/3.0);
|
Booleans, with boolean operators as you'd expect.
|
System.out.println(true && false);
System.out.println(true || false);
System.out.println(!true);
}
|