VARIABLES 101
DATA TYPES
NAMING RULES
COMMON MISTAKES
100

A named container in memory that stores a value.

What is a variable?

100

The most commonly used data type for whole numbers in Java.

What is int?

100

Variable names cannot start with this

What is a number?

100

Java will throw this type of error if you use a variable before giving it a value.

What is a compile error?

200

This is what you must do before you can use a variable in Java.

What is declare it?

200

The data type used to store someone's name or a sentence.

What is String?

200

The naming convention used for Java variables.

What is camelCase?

200

This happens when you try to store a String into an int variable.

What is a type error / the program won't compile?

300

The process of giving a variable its first value.

What is initialization?

300

The data type that stores true or false.

What is boolean?

300

The reason you can't use 'int' or 'class' as a variable name.

What are reserved Java keywords?

300

The difference between = and == in Java.

What is = assigns a value, == checks if two values are equal?

400

These three real-world examples from the presentation use variables: games, websites, and this.

What is banking applications?

400

This is the data type for a single letter or character like 'A'.

What is char?

400

True or false: 'score' and 'Score' are the same variable in Java.

What is false?

400

This is wrong with the variable name: int 2score;

What is variable names cannot start with a number?

500

This is the data type you'd use to store a GPA of 3.9

What is double

500

This is why you'd use double instead of int to store a student's GPA.

Because GPA has decimals and int can only store whole numbers?


500

What is wrong with: String first name;

What is variable names cannot contain spaces?

500

Why naming variables x or temp is considered a mistake.

What is they are vague and make the code hard to read and debug?