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 3

Let Me Say This about this

IN THIS CHAPTER

Bullet Passing an object to a method

Bullet Comparing class and instance methods

Bullet Understanding this

Bullet Working with local functions

This chapter moves from the static methods emphasized in Chapter 2 in this minibook to the instance methods of a class. Static methods belong to the whole class, and instance methods belong to each instance created from the class. Important differences exist between static and instance class members, such as the passing of objects (no, it's not a matter of objectifying anything — it’s just the term used for all sorts of real-world entities, none of which are degraded by the code in this chapter).

You also discover that the keyword this identifies the instance, rather than the class as a whole, or properties defined as part of the method or passed to the method. The this keyword lets you do all sorts of amazing things.

Chapter 2 also discusses local functions as part of the refactoring process used to make your code more readable. However, you don't have to wait until you refactor your code to use a local function. ...

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