|
3 | 3 |
|
4 | 4 | Whether you realized it or not, you've been calling C# methods ever since your first "Hello, World!" application. That application uses the `WriteLine()` method of the `Console` class to display the "Hello, World!" message.
|
5 | 5 |
|
6 |
| -However, not all classes and methods are implemented the same way. This unit covers some of the most common variants that you'll need to understand when using methods from the .NET Class Library. More importantly, you'll learn how to find and use the documentation to better understand more about each method. |
| 6 | +However, not all classes and methods are implemented as the same way. This unit covers some of the most common variants that you'll need to understand when using methods from the .NET Class Library. More importantly, you'll learn how to find and use the documentation to better understand more about each method. |
7 | 7 |
|
8 | 8 | ## How to call methods in the .NET Class Library
|
9 | 9 |
|
@@ -140,7 +140,7 @@ A single class can support both stateful and stateless methods. However, when yo
|
140 | 140 |
|
141 | 141 | ## Creating an instance of a class
|
142 | 142 |
|
143 |
| -An instance of a class is called an *object*. To create a new instance of a class, you use the `new` operator. Consider the following line of code that creates a new instance of the `Random` class to create a new object called `dice`: |
| 143 | +An instance of a class is called as an *object*. To create a new instance of a class, you use the `new` operator. Consider the following line of code that creates a new instance of the `Random` class to create a new object called `dice`: |
144 | 144 |
|
145 | 145 | ```c#
|
146 | 146 | Random dice = new Random();
|
@@ -221,4 +221,4 @@ Try accessing the `Random.Next()` method directly and see what happens.
|
221 | 221 | - When calling a stateless method, you don't need to create a new instance of its class first.
|
222 | 222 | - When calling a stateful method, you need to create an instance of the class, and access the method on the object.
|
223 | 223 | - Use the `new` operator to create a new instance of a class.
|
224 |
| -- An instance of a class is called an *object*. |
| 224 | +- An instance of a class is called as an *object*. |
0 commit comments