All lessons

Methods

9 min · C#

Package code under a name so you can reuse it (C# calls them methods).

C# · Methods0/5 cleared

Enemy 1 of 5

A method names a block of code. Declare its return type and parameter types; static lets Main call it directly.

Use return to hand a value back.

You
Syntax Skeleton

Loading editor...

Ln 1, Col 1Spaces: 4
Sign up to fightTarget output: 10