Data Types Flashcards
Types and their operators
How many primitive types are there in Java?
Eight.
What are the different integer types?
int, byte, short, long
What are the arthimetic binary operators?
\+, addition -, subtraction *, multiplication /, division %, modulus
What is a floating point number?
A number with a decimal/a fractional number.
What are the different floating point types?
float, double
How many relational operators are there?
Six
How many logical operators are there?
Six
What are the different relational operators?
==, equal to !=, not equal to >, greater than =, greater than or equal to <=, less than or equal to
What is a relational operator?
How values can relate and compare with one another.
What is a logical operator?
Logical refers to the ways in which true and false values can be connected together.
What type represents binary state?
boolean
What type represents characters?
char
How do you specify a character type?
With single quotes around the character.
‘C’ represents C.
How do you declare a variable?
typeName variableName;
Ex. int totalCount;
What is the difference between declaring and initializing a variable?
Declaring a variable allocates the required amount of memory.
Initializing a variable assigns a newly declared variable a tangible value.