Module 2: Representing Infomation Flashcards
What are the two types of variables?
Reference and Primitives’
What is a print statement?
A print statement is how we get a command to print to our console.
What is a variable
Something that represents a piece of data. The value may or may not be known at the time of declaration (creation) and can be changed.
What is a Primitive?
A primitive is for storing simple values… int, float, double, long, boolean, char, byte, and short.
What is a reference variable?
A reference variable stars, a memory address of an object. We say that the variable “refers” to the object.
System.out.println();
Java method that lets us print out a line of output, followed by a newline to the user.
System.out.print();
Prints output without a newline
What is a data type?
Indicates the type of data, a memory, location (variable or named constant) can store.
What are the different data types in Java?
int, float, double, short, byte, boolean, long, and char…
String in Java is actually a non-primitive data type
Boolean
A single value of either TRUE or FALSE
char data type
Used to hold any single character
int data type
A primitive data type that represents integer values. Ranges from -2147483648 to 2147483648
float data type
Holds a floating point value of up to six or seven significant digits ID accuracy
double data type
Can hold a floating point value of up to 14 or 15 significant digits of accuracy
short data type
holds small integers from -32,768 to 32,767