Primitive Types
Java has most of the same basic primitive types as C and C++ (int, short, long, float, double, and char), but Java adds the types byte and boolean. The Java type boolean corresponds to the C++ type bool. Java has no type named long double. Unless using the primitive data types introduced in C++11, in Java the size, in bytes, of a value for some specific primitive type is fully specified and is not implementation dependent. See Chapter 2 for details.
Strings
Unlike some versions of C and C++, in Java strings are not special kinds of arrays of characters. Java has a class String that serves as a predefined type. String is somewhat similar to the class string in recent versions of C++. (Coverage of the String class starts in Chapter ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access