Documentation Examples
Documentation Examples
Say I have an example class TestClass with three functions a(), b(), c() and a class SecondClass with
two functions e() and f(). should be laid out in the following way:
TestClass.a():
description goes here
TestClass.b():
description goes here
TestClass.c():
description goes here
SecondClass.e():
description goes here
SecondClass.f():
description goes here
This is done for all classes you define. Only your Kotlin code should be discussed. The XML
should be left out.
For the purposes of code documentation lets assume I have a function sum() that looks like this
TestClass.sum(nums):
Takes in an array of floating point numbers and iterates through them to produce the overall
sum of those numbers which is return to the user
TestClass.sum(nums):
initialises a variable total to zero then does a for loop from i to nums.size(). In the loop we
add size to total before returning total after the loop