Primitive Data Types

¡Supera tus tareas y exámenes ahora con Quizwiz!

Numeric literal

An explicit number used in a program Treated as a long value if the character l or L is appended to it

Wrapper class

Can be used to represent a primitive value as an object if needed Also have helpful methods and constants related to their data type.

Unicode character set

Contains thousands of characters and symbols from languages used all over the world. It also includes symbols from special domains such as mathematics, currency, and Braille.

Numeric types in Java are signed, meaning _________________

Each number is either positive or negative

T or F: Characters in Java are represented using the ASCII character set.

False Java uses the Unicode character set.

T or F: The float and long data types both represent floating-point values.

False The long data type represents a long integer.

T or F: The byte data type represents a true or false value.

False The true/false data type is called a boolean.

T or F: There are exactly six primitive data types in Java.

False There are eight primitive types.

True or False Internally, an uppercase letter ('A') is treated the same as its lowercase version ('a').

False Uppercase and lowercase letters are distinct.

Numbers with a decimal point are called ________________

Floating-point numbers because they are stored in scientific notation.

Grouping character

In text, the comma is often used to make large numbers easier to read (such as 32,767), but you CANNOT use commas in a numeric literal in a program

byte (size, type, min/max values)

Size: 1 byte (8 bits) Min: -128 Max: 127

short (size, type, min/max values)

Size: 2 bytes (16 bits) Min: -32,768 Max: 32,767

int (size, type, min/max values)

Size: 4 bytes (32 bits) Min: -2,147,483,648 Max: 2,147,483,647

long (size, type, min/max values)

Size: 8 bytes (64 bits) Min: -9,223,372,036,854,775,808 Max: 9,223,372,036,854,775,807

T or F: A numeric literal is an explicit number used in a program.

True As opposed to a variable or a named constant.

T or F: Numeric primitive values in Java are signed.

True Each is either positive or negative.

T or F: The int and short data types both represent integers.

True They differ by how big the integer can be.

float (size, type, min/max values)

Size: 4 bytes (32 bits) Min: -3.4 x 1038 (7 significant digits) Max: 3.4 x 1038 (7 significant digits)

Sign bit

The eighth bit that is used to represent the sign

double (size, type, min/max values)

Size: 8 bytes (64 bits) Min: -1.7 x 10308 (15 sig. digits) Max: 1.7 x 10308 (15 sig. digits)

Character Set

The characters that can be represented in a programming language are defined by this


Conjuntos de estudio relacionados

Three main parts of the computer

View Set

Entrepreneurship exam study guide

View Set

Chapter 17: Banking and the Management of Financial Institutions

View Set

UNRS 107 Quiz_Prep_Surgical pt_Rational - ATI Quiz #3 Prep (The surgical client)

View Set

U12Ch46 어(魚/漁): fish, to fish (KBC)

View Set

Test 4 Chapters 22-27 (In class questions)

View Set

level 1 antiterrorism awareness training

View Set