Recall & Review
beginner
What is a method that operates on state in C#?
A method that operates on state is a function inside a class that changes or uses the class's fields (variables) to affect the object's data.Click to reveal answer
beginner
Why do methods that operate on state use 'this' keyword in C#?
The 'this' keyword refers to the current object instance, helping methods access or change the object's own fields clearly.
Click to reveal answer
beginner
Example: What does this method do?
public void IncreaseAge() { age += 1; }This method adds 1 to the 'age' field of the object, changing its state by increasing the age value.
Click to reveal answer
intermediate
What is the difference between a method that operates on state and a static method?
A method that operates on state works on an instance's data (fields), while a static method belongs to the class itself and does not use instance data.Click to reveal answer
beginner
How do methods that operate on state help in real-life programming?
They let objects remember and change their own data, like a bank account object updating its balance when you deposit money.Click to reveal answer
What does a method that operates on state usually do?
✗ Incorrect
Methods that operate on state work with the object's own data fields.
Which keyword helps a method access the current object's fields?
✗ Incorrect
The 'this' keyword refers to the current object instance.
What happens if a method changes a field value?
✗ Incorrect
Changing a field value updates the object's state.
Which method type does NOT operate on instance state?
✗ Incorrect
Static methods belong to the class and do not use instance data.
Why are methods that operate on state useful?
✗ Incorrect
These methods let objects remember and change their own data.
Explain what a method that operates on state is and give a simple example in C#.
Think about how an object can change its own data.
You got /3 concepts.
Describe the difference between instance methods that operate on state and static methods.
Consider where the method belongs and what data it can access.
You got /3 concepts.