Java Primitives
There are 8: boolean, byte, char, short, int, long, float and double.
5 flashcards · Programming Languages · by lakesare
There are 8 primitive data types. Into what 4 groups can they be subdivided?
4 integer: byte, short, int, long. 2 floating-point: float, double. char, boolean.
Name 4 integer data types in Java and their sizes.
byte - 8-bit short - 16-bit int - 32-bit long - 64-bit All are signed integers.
What are the min and max values of byte rrr = 15; ?
byte can take up to 8 bit, therefore it can take up to 28 values. 256/2 = 128. min: -128, max: 127 (considering 0).
By default Java thinks 15.54 is a?
double. To designate it as float, use 15.54f.
How to indicate a signed number in Java?
All numbers are signed in Java, Java doesn't support unsigned data types. C supports signed (the default) and unsigned numbers. Java supports only signed numbers.