August 2017
Beginner
566 pages
12h 34m
English
To begin, we'll create methods; so, start by entering the following:
private static void ChangeArray(int[] arr)
Here, we say private and then static and void this time. The void keyword simply means that our method will perform an action, but it will not send a numerical value, such as 10, back to where it's called. It will do something, but not send a numerical value, such as 10, back.
Next, we add ChangeArray as the name of the method. We pass in an array of integers (int) and then arr. That's all our method will do to illustrate the concept.
Let's add comment 5 before going further. Obviously, you've seen a lot of this before, but perhaps you haven't seen void. So, type the following above this line:
//5. void ...
Read now
Unlock full access