Consider:
public void DisplayRoster()
{
}
At this stage, notice three important parts:
public → access
void → return type
DisplayRoster → method name
()
The parentheses are part of the method declaration.
Parameters are taught later, so current examples use an empty parameter list.
A method name such as:
DisplayRoster
should help a reader understand what the method is intended to do.
void Means No Value Is ReturnedFor:
public void DisplayRoster()
void means the method does not return a value to its caller.
Returning values is taught later in PC1.
A method can have an access modifier such as public or private.
The current class design controls whether code outside the class should be able to call it directly.
If team1 refers to a Team object:
team1.DisplayRoster();
the call identifies the object and invokes the method.
This connects:
method definition
↓
method call
The next activities focus on what a method is and how a void method behaves.