Store the company name
A String holds text.
LessonRead this before the challenge.
A variable is a named box that holds one value. In Apex you write the kind of value first, then the name, then the value:
String country = 'Canada';String is the type, and it means text. country is the name. The text sits inside single quotes, and the line ends with a semicolon.
A box can also start out empty. Apex calls that null:
String nickname = null;The common trap is the quotes. Apex text always uses single quotes, and double quotes do not work at all:
String country = "Canada";This line will not compile. Switch to single quotes and it runs. A missing semicolon also stops the code from compiling, and the error often points at the next line, which can be confusing.
Your task
A setup script keeps details about a client company in variables. The first one, companyName, has no value yet. It is null.
In the starter, set companyName to the text RidgePoint Capital. Keep the String type, put the text in single quotes, end the line with a semicolon, and leave the other variables as they are.
For example, String country = 'Canada'; stores the text Canada in country because single quotes mark a piece of text in Apex.
String city = 'Denver';
String companyName = null;Requirements
- Stores
RidgePoint Capitalin companyName - Keeps companyName as a String
- Gives companyName a real value instead of null
- Uses single quotes around the name
- Leaves the city line unchanged