Bargains With Evil
From Huben's Wiki
(→Read The Contract Carefully!) |
|||
Line 58: | Line 58: | ||
==Create Your Own Contracts== | ==Create Your Own Contracts== | ||
# Add a method to Evil that has int[] as an argument which returns the sum of the first three elements in the array. | # Add a method to Evil that has int[] as an argument which returns the sum of the first three elements in the array. | ||
− | # In Innocent.main(), create a local variable array with at least 3 elements | + | # In Innocent.main(), create a local variable array with at least 3 initialized elements (curly braces!) |
# Add a call to your new Evil method using the array for the argument. Print the result. | # Add a call to your new Evil method using the array for the argument. Print the result. | ||