Variables Practice#
This question is to assess your understanding of the syntax and use of variables.
Question
Suppose I now wanted to create a variable called year
that stores a student’s year (as a Freshman). What would be the correct syntax to create this variable?
string year = "Freshman";
String year = 'Freshman';
String year = Freshman;
String year = "Freshman";
See Answer
Option 4 is correct!
Option 1: String should be spelled with a capital S
Option 2: We use double quotes (“”) to represent Strings
Option 3: We forgot the double quotes!