0
Take this example:
private int age;
public int Age { get; set;}
The "age" variable is encapsulated. What does it mean? It can't be read or modified anywhere else than in it's own class as it is private but through the Age variable it can be read through "get" and modified through "set". So if you say (for example the class name is "Person") Person.Age = 18; the age variable will be equal to 18. As the methods encapsulate their parameters this is the encapsulation method for classes.
As for the return statements...
Take this function:
bool checkAge(int age)
{
if(age >= 18) {
return true;
}
return false;
}
The return is transforming a method(function) into a variable (not literarlly). For example you could assign it's return to a variable:
var isOldEnough = checkAge(Person.Age);
If the whole code above would be linked checkAge() would return true and the variable isOldEnough will have this value.
These can get a bit tricky at the begining but practice makes it perfect!



