Skip to content

Instantly share code, notes, and snippets.

@niavesper
Created February 14, 2020 02:45
Show Gist options
  • Save niavesper/6f63c68a586f6cc8b97ed02a7111789e to your computer and use it in GitHub Desktop.
Save niavesper/6f63c68a586f6cc8b97ed02a7111789e to your computer and use it in GitHub Desktop.
Week_1_Homework_Primitives.cls
public static void primitivesExercise() {
//You do this part!
//1. Declare three primitives variables, an Integer, a String and a Decimal
Integer numCatPaws;
String catName;
Decimal numFurnitureDestroyed;
//2. Assign values to your three new variables
numCatPaws = 4;
catName = 'Bandicoot';
numFurnitureDestroyed = 2.5;
//3. Print out your variables to the debug log
System.debug('My new cat has ' + numCatPaws + ' paws.');
System.debug('Her name is ' + catName + '.');
System.debug('So far, she has destroyed ' + numFurnitureDestroyed + ' pieces of furniture. But I love her anyway!');
//4. Declare an integer variable and assign a value in the same line
Integer numFavoriteToys = 3;
//5. Print out your integer to the debug log
System.debug('Bandicoot has ' + numFavoriteToys + ' favorite toys.');
}
@dharmarajan-krithika
Copy link

I love cats :) Great work creating the variables and assigning them values. Good naming convention. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment