Intro to programming UNIT 2 Flashcards
How many characters does ASCII and UNICODE share?
The first 256 Characters
Why do you specify datatypes
It tell the compiler how much memory to set aside for the variable and how to interpret the data in memory
What naming convention do you use for a class
TitleCase. Every word is capitalized and has no spaces
What are the datatypes for whole numbers and how many bits does each use
byte (8 bits)
short (16 bits)
int (32 bits)
long (64 bits)
What is the naming convention for variable names
camelCase. The first word is not capitalized and every word after is capitalized
What makes a valid variable name
Must start with a letter, underscore or a dollar sign
Cannot start with a digit
Not a java reserved keyword
What is the naming convention for constants
Every Letter is capitalized and spaces are underscores
TAX_RATE
How do you declare a constant?
Using the final keyword
What are variable names also known as
Identifier
Reference
Handle
What is the only thing in java that is not an object?
Primitive data types
How many primitive datatypes are there in java
Eight
What are the two non numeric data types? And what are their sizes?
char (16 bits) - will hold a single unicode value
boolean (8 bits) - will hold a true false value
What are the signed floating point data primitives and their sizes
float (32 bits)
double (64 bits)
What is the var datatype?
It’s an inferred datatype. The compiler looks at the data going into the variable and chooses the correct data type for it
When can you use the var datatype?
It can only be used when creating local variables within a method