Skip to Main Content
C# 10.0 All-in-One For Dummies
book

C# 10.0 All-in-One For Dummies

by John Paul Mueller
March 2022
Intermediate to advanced content levelIntermediate to advanced
864 pages
19h 46m
English
For Dummies
Content preview from C# 10.0 All-in-One For Dummies

Chapter 2

We Have Our Methods

IN THIS CHAPTER

Bullet Defining a method

Bullet Passing arguments to a method

Bullet Getting results back

Bullet Reviewing the WriteLine() method

Programmers need to be able to break large programs into smaller chunks that are easy to handle. For example, some programs contained in previous chapters of this minibook reach the limit of the amount of programming information a person can digest at one time. Many developers use rules like being able to see all the code for a particular task on a single monitor screen or printed piece of paper. The idea is that it's hard to keep scrolling back and forth to see what a particular piece of code does.

This chapter looks at methods, which is one way to split code into smaller pieces. C# lets you divide your class code into methods. A method is equivalent to a function, procedure, or subroutine. C# 7.0 and above supports something called a local function, which is really a method in disguise, but it lurks inside another method (the terminology appears to just confuse matters — that’s right, take a deep breath and move on). The difference ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C# Cookbook

C# Cookbook

Joe Mayo
Head First C#, 4th Edition

Head First C#, 4th Edition

Andrew Stellman, Jennifer Greene

Publisher Resources

ISBN: 9781119839071Purchase Link