
Java
1) List the eight basic data types used in
Java. Give examples. The basic types are also known as primitive types and when a variable is declared as any of them, the computer creates what you can call a 'box' in its memory that is big enough to hold a value of that type. Eg int x; // at runtime, computer creates a box called 'x' big enough to hold an integer an integer can be anything between -2147483638 to 2147483647 the other seven primitive (or basic) data types are byte - anything between -128 to 127 short - anything between -32768 to 32767 long - anything between -9223372036854775808 to 9223372036854775807 float - anything between -1.4 * 10^-45 to 3.4 * 10^38 double - anything between -4.9 * 10^-324 to 1.8 * 10^308 char - any single digit on your keyboard (unicode) boolean - true or false source: charatan and kans
Java in two semesters pg 19